<template >
  <div class="wrap-table fllow-manage">
    <el-form
      ref="form"
      :model="searchData"
      label-width="100px"
      class="clearfix flex-div"
    >
      <el-form-item
        label="访谈日期"
        class
        label-width="70px"
        style="width: 340px"
      >
        <div class="block">
          <el-date-picker
            v-model="timeDate"
            type="daterange"
            align="right"
            unlink-panels
            range-separator="至"
            value-format="yyyy-MM-dd"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            :picker-options="pickerOptions"
          ></el-date-picker>
        </div>
      </el-form-item>
      <el-form-item
        label="计划访谈类型"
        class
        label-width="120px"
        style="width: 250px"
      >
        <el-select
          v-model="searchData.followUpType"
          clearable
          placeholder="请选择"
        >
          <el-option
            v-for="item in options1JH"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="实际访谈类型"
        class
        label-width="120px"
        style="width: 250px"
      >
        <el-select
          v-model="searchData.actualFollowUpType"
          clearable
          placeholder="请选择"
        >
          <el-option
            v-for="item in options1"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="所在地区" class="item-right" style="width: 200px">
        <el-select
          v-model="searchData.districtNo"
          placeholder="请选择"
          @change="changeDis"
          clearable
          :disabled="JSON.parse(UserDic).IsCommunityOnly == '1'"
        >
          <el-option
            v-for="item in optionDiq"
            :key="item.DistrictName"
            :label="item.DistrictName"
            :value="item.DistrictNo"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="所在社区" class="item-right" style="width: 170px">
        <el-select
          v-model="CtyIds"
          placeholder="请选择"
          @change="Commutysp"
          clearable
          :disabled="JSON.parse(UserDic).IsCommunityOnly == '1'"
        >
          <el-option
            v-for="item in optionsData"
            :key="item.SYS_ID"
            :label="item.CName"
            :value="item"
          ></el-option>
        </el-select>
      </el-form-item>
      <!---->
      <!--<transition name="fade">-->
      <!--<div class="moreSearch" v-show="showActive">-->
      <el-form-item label="预约状态" class style="width: 200px">
        <el-select
          v-model="searchData.appointState"
          clearable
          placeholder="请选择"
        >
          <el-option
            v-for="item in options2"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="事项状态" class style="width: 200px">
        <el-select
          v-model="searchData.followUpState"
          clearable
          placeholder="请选择"
        >
          <el-option
            v-for="item in options3"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="当前干预强度"
        label-width="110px"
        class="item-right"
        style="width: 180px"
      >
        <el-select
          v-model="searchData.intensityOfIntervention"
          clearable
          placeholder="请选择"
        >
          <el-option
            v-for="item in options9"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="访谈人员"
        label-width="100px"
        class="item-right"
        style="width: 200px"
      >
        <el-select v-model="searchData.NurseId" clearable placeholder="请选择">
          <el-option
            v-for="item in SearchoptionsNurse"
            :key="item.NurseId"
            :label="item.NurseName"
            :value="item.NurseId"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="访谈时研究阶段"
        label-width="120px"
        class
        style="width: 220px"
      >
        <el-select v-model="searchData.period" clearable placeholder="请选择">
          <el-option
            v-for="item in options2sp"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="试验类型" class="item-right" style="width: 260px">
        <el-select v-model="searchData.testType" clearable placeholder="请选择">
          <el-option
            v-for="item in options6"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="对象状态" class style="width: 190px">
        <el-select
          v-model="searchData.userState"
          clearable
          placeholder="请选择"
        >
          <el-option
            v-for="item in options4"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="儿童身长体重测量了吗"
        label-width="170px"
        class
        style="width: 370px"
      >
        <el-select
          v-model="searchData.hasDoPhysiqueMeasure"
          clearable
          placeholder="请选择"
        >
          <el-option value label="全部"></el-option>
          <el-option value="1" label="已测量"></el-option>
          <el-option value="2" label="未测量(电话访谈)"></el-option>
          <el-option value="3" label="未测量(面对面改为电话访谈)"></el-option>
          <el-option value="4" label="未测量(儿童没有来)"></el-option>
          <el-option value="5" label="未测量（访谈取消了）"></el-option>
          <el-option value="6" label="未测量(技术性原因，请备注)"></el-option>
          <el-option value="7" label="未测量(其他，请备注)"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item class label>
        <el-input
          v-model="searchData.keyWord"
          style="width: 210px; margin-left: -60px"
          placeholder="研究对象手机号、研究编号"
        ></el-input>
      </el-form-item>
      <!--</div>-->
      <!--</transition>-->
      <div class="flex-r-but">
        <el-button type="success" @click="outPut" class="mg-lr-20 pd-bt"
          >导出</el-button
        >
        <el-button type="primary" @click="checkList" class="mg-lr-20 pd-bt"
          >查询</el-button
        >
        <el-button
          type=""
          v-if="hasDoctorReport"
          @click="handleQuestion"
          class="pd-bt"
          >自我报告问卷</el-button
        >
        <span
          v-if="doctorReport.FillinState == 0"
          style="
            width: 11px;
            height: 11px;
            background: #f00;
            border-radius: 50%;
            display: inline-block;
          "
        ></span>
      </div>
    </el-form>
    <!---->
    <template>
      <el-table
        :data="tableData"
        border
        id="outtableFirst"
        v-loading="loading"
        element-loading-text="加载中"
        style="width: 100%"
      >
        <el-table-column align="center" label="质控标识" width="80">
          <template slot-scope="scope">
            <el-tooltip
              v-if="scope.row.QCState == 1"
              class="item"
              content="被随机选中要做质控的健康访谈"
              placement="top"
            >
              <span
                style="
                  display: inline-block;
                  border: 1px solid #0066ff;
                  color: #0066ff;
                  border-radius: 50%;
                  padding: 0px 4px;
                "
                >录</span
              >
            </el-tooltip>
            <el-tooltip
              v-else-if="scope.row.QCState == 2"
              class="item"
              content="研究对象已经口头知情同意"
              placement="top"
            >
              <span
                style="
                  display: inline-block;
                  border: 1px solid #f59a23;
                  color: #f59a23;
                  border-radius: 50%;
                  padding: 0px 4px;
                "
                >录</span
              >
            </el-tooltip>
            <el-tooltip
              v-else-if="scope.row.QCState == 3"
              class="item"
              content="研究对象已经电子知情同意"
              placement="top"
            >
              <span
                style="
                  display: inline-block;
                  border: 1px solid #008000;
                  color: #008000;
                  border-radius: 50%;
                  padding: 0px 4px;
                "
                >录</span
              >
            </el-tooltip>
            <el-tooltip
              v-else-if="scope.row.QCState == 4"
              class="item"
              content="完成质控"
              placement="top"
            >
              <span
                class="el-icon-circle-check"
                style="color: #008000; font-size: 18px"
              ></span>
            </el-tooltip>
            <el-tooltip
              v-else-if="scope.row.QCState == 5"
              class="item"
              content="研究对象拒绝"
              placement="top"
            >
              <span
                class="el-icon-circle-close"
                style="color: #e55366; font-size: 18px"
              ></span>
            </el-tooltip>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="Surname"
          label="姓名首字母"
          fixed="left"
          align="center"
          min-width="100"
        ></el-table-column>
        <el-table-column label="手机号" align="center" min-width="100">
          <template slot-scope="scope">
            <el-tooltip :content="scope.row.Mobile" placement="top">
              <span class="click_line" @click="JumpUserinfo(scope.row)">{{
                scope.row.Mobile | mobileFilter
              }}</span>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-table-column
          prop="ResearchNo"
          label="研究编号"
          align="center"
          min-width="120"
        ></el-table-column>
        <el-table-column
          prop="FollowUpDate"
          align="center"
          label="访谈日期"
          min-width="160"
        >
          <template slot-scope="scope">
            <span class="excelHidden">({{ scope.row.FollowUpDate }})</span>
            <el-date-picker
              v-model="scope.row.FollowUpDate"
              :clearable="false"
              :disabled="true"
              @change="changeFollowUpDate(scope.row, scope.row.FollowUpDate)"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择日期"
            ></el-date-picker>
          </template>
        </el-table-column>
        <el-table-column
          prop="FollowUpTime"
          label="预约时间"
          align="center"
          min-width="120"
        >
          <template slot-scope="scope">
            <span class="excelHidden">({{ scope.row.FollowUpTime }})</span>
            <el-time-select
              v-model="scope.row.FollowUpTime"
              :clearable="false"
              @change="changeFollowUpDateOne(scope.row, scope.row.FollowUpDate)"
              :picker-options="{ start: '08:00', step: '00:15', end: '21:30' }"
              placeholder
            ></el-time-select>
          </template>
        </el-table-column>
        <el-table-column
          prop="ScheduleName"
          label="事项标题"
          align="center"
          :show-overflow-tooltip="true"
          min-width="120"
        ></el-table-column>
        <el-table-column
          prop="FollowUpType"
          label="计划访谈类型"
          :formatter="FollowUpTypeFilter"
          align="center"
          min-width="150"
        >
        </el-table-column>
        <el-table-column
          prop="ActualFollowUpType"
          :formatter="ActualFollowUpTypeFilter"
          label="实际访谈类型"
          align="center"
          min-width="150"
        >
          <template slot-scope="scope">
            <span class="excelHidden"
              >({{
                scope.row.ActualFollowUpType | ActualFollowUpTypeFilter
              }})</span
            >
            <el-select
              v-model="scope.row.ActualFollowUpType"
              placeholder="请选择"
              @change="
                changeFollowUpDate(scope.row, scope.row.ActualFollowUpType)
              "
            >
              <el-option
                v-for="item in options1SJ"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column
          prop="AppointState"
          label="预约状态"
          align="center"
          :formatter="AppointFilter"
          min-width="120"
        >
          <template slot-scope="scope">
            <span class="excelHidden"
              >({{ scope.row.AppointState | AppointState }})</span
            >
            <el-select
              v-model="scope.row.AppointState"
              placeholder="请选择"
              @change="changeFollowUpDate(scope.row, scope.row.AppointState)"
            >
              <el-option
                v-for="item in options2s"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column
          prop="FollowUpState"
          label="事项状态"
          :formatter="FollowUpFilter"
          align="center"
          min-width="120"
        >
          <template slot-scope="scope">
            <span class="excelHidden"
              >({{ scope.row.FollowUpState | FollowUpState }})</span
            >
            <el-select
              v-model="scope.row.FollowUpState"
              placeholder="请选择"
              @change="changeFollowUpState(scope.row, scope.row.FollowUpState)"
            >
              <el-option
                v-for="item in options3s"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column label="生活方式问卷" align="center" min-width="120">
          <template slot-scope="scope">
            <span class="click_line" @click="jumpQuestion(scope.row)">{{
              scope.row.FillInQuestionnaireState | IsFillInQuestionFilter
            }}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="Nurse"
          label="访谈人员"
          align="center"
          min-width="120"
        >
          <template slot-scope="scope">
            <span class="excelHidden">({{ scope.row.Nurse }})</span>
            <el-select
            :disabled="scope.row.QCState != null"
              v-model="scope.row.Nurse"
              placeholder="请选择"
              @change="changeNurse(scope.row, scope.row.Nurse)"
            >
              <el-option
                v-for="item in optionsNurse"
                :key="item.NurseId"
                :label="item.NurseName"
                :value="item.NurseName"
              ></el-option>
            </el-select>
          </template>
        </el-table-column>

        <el-table-column
          prop="Period"
          label="访谈时研究阶段"
          :formatter="PeriodFilter"
          align="center"
          min-width="120"
        ></el-table-column>
        <el-table-column
          prop="IntensityOfIntervention"
          label="访谈时干预强度"
          :formatter="IntensityFilter"
          align="center"
          min-width="150"
        ></el-table-column>
        <el-table-column
          prop="CurrentIntensityOfIntervention"
          label="当前干预强度"
          :formatter="IntensityFilter"
          align="center"
          min-width="150"
        ></el-table-column>
        <el-table-column
          prop="DistrictName"
          :formatter="DistrictNameFilter"
          label="所在地区"
          align="center"
          min-width="100"
        ></el-table-column>
        <el-table-column
          prop="CName"
          label="所在社区"
          align="center"
          min-width="100"
        ></el-table-column>
        <el-table-column
          prop="UserState"
          label="对象状态"
          :formatter="UserStateFilter"
          align="center"
          min-width="100"
        ></el-table-column>
        <el-table-column
          prop="Remark"
          label="事项备注"
          align="center"
          min-width="120"
        >
          <template slot-scope="scope">
            <span class="excelHidden">{{ scope.row.Remark || "-" }}</span>
            <el-input
              @blur="changeFollowUpDate(scope.row, scope.row.Remark)"
              v-model="scope.row.Remark"
              placeholder="事项备注"
            ></el-input>
          </template>
        </el-table-column>
        <el-table-column
          prop="CancleReason"
          label="事项取消原因"
          align="center"
          min-width="180"
        >
          <template slot-scope="scope">
            <span class="excelHidden">({{ scope.row.Nurse }})</span>
            <el-select
              v-model="scope.row.CancleReason"
              placeholder="请选择"
              @change="changeFollowUpDate(scope.row, scope.row.CancleReason)"
            >
              <el-option
                value="研究对象没有来"
                label="研究对象没有来"
              ></el-option>
              <el-option
                value="访谈人员没有时间"
                label="访谈人员没有时间"
              ></el-option>
              <el-option value="其他" label="其他"></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column
          prop="CancleReasonDetail"
          label="事项取消具体原因"
          align="center"
          min-width="160"
        >
          <template slot-scope="scope">
            <span class="excelHidden">{{
              scope.row.CancleReasonDetail || "-"
            }}</span>
            <el-input
              @blur="
                changeFollowUpDate(scope.row, scope.row.CancleReasonDetail)
              "
              v-model="scope.row.CancleReasonDetail"
              placeholder="事项取消具体原因"
            ></el-input>
          </template>
        </el-table-column>
        <el-table-column
          prop="HasDoPhysiqueMeasure"
          label="儿童身长体重测量了吗"
          align="center"
          min-width="180"
        >
          <template slot-scope="scope">
            <span class="excelHidden"
              >({{ scope.row.HasDoPhysiqueMeasure }})</span
            >
            <el-select
              v-model="scope.row.HasDoPhysiqueMeasure"
              placeholder="请选择"
              @change="
                changeFollowUpDate(scope.row, scope.row.HasDoPhysiqueMeasure)
              "
            >
              <el-option value="1" label="已测量"></el-option>
              <el-option value="2" label="未测量(电话访谈)"></el-option>
              <el-option
                value="3"
                label="未测量(面对面改为电话访谈)"
              ></el-option>
              <el-option value="4" label="未测量(儿童没有来)"></el-option>
              <el-option value="5" label="未测量（访谈取消了）"></el-option>
              <el-option
                value="6"
                label="未测量(技术性原因，请备注)"
              ></el-option>
              <el-option value="7" label="未测量(其他，请备注)"></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column
          prop="UnMeasureReason"
          label="未测量原因"
          align="center"
          min-width="160"
        >
          <template slot-scope="scope">
            <span class="excelHidden">{{
              scope.row.UnMeasureReason || "-"
            }}</span>
            <el-input
              @blur="changeFollowUpDate(scope.row, scope.row.UnMeasureReason)"
              v-model="scope.row.UnMeasureReason"
              placeholder="未测量原因"
            ></el-input>
          </template>
        </el-table-column>
        <el-table-column
          prop="OralConsent"
          label="口头知情同意"
          align="center"
          min-width="160"
        >
          <template slot-scope="scope">
            <span class="excelHidden">({{ scope.row.OralConsent }})</span>
            <el-select
              v-model="scope.row.OralConsent"
              placeholder="请选择"
              :disabled="
                !scope.row.QCState ||
                (scope.row.SelfFeedbackState == 1 &&
                  scope.row.SoundRecording != undefined)
              "
              @change="changeZk(scope.row, scope.row.OralConsent)"
            >
              <el-option value="1" label="同意"></el-option>
              <el-option value="2" label="拒绝"></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column
          prop="WrittenConsent"
          label="电子知情同意"
          align="center"
          min-width="160"
        >
          <template slot-scope="scope">
            <span class="excelHidden">({{ scope.row.WrittenConsent }})</span>
            <el-select
              v-model="scope.row.WrittenConsent"
              :disabled="
                !scope.row.QCState ||
                (scope.row.SelfFeedbackState == 1 &&
                  scope.row.SoundRecording != undefined)
              "
              placeholder="请选择"
              @change="changeDZ(scope.row, scope.row.WrittenConsent)"
            >
              <el-option value="1" label="同意"></el-option>
              <el-option value="2" label="拒绝"></el-option>
            </el-select>
          </template>
        </el-table-column>
        <el-table-column
          prop="SoundRecording"
          label="录音文件"
          align="center"
          min-width="160"
        >
          <template slot-scope="scope">
            <span
              v-if="scope.row.SoundRecording"
              @click="removeAudio(scope.row)"
              class="el-icon-close"
              style="color: #f00"
            ></span
            ><span
              style="cursor: pointer"
              @click="download(scope.row)"
              v-if="scope.row.SoundRecording"
              >{{ scope.row.SoundRecording
              }}<i class="el-icon-download" style="color: #409eff"></i
            ></span>
            <el-upload
              v-else
              class="upload-demo"
              :action="PostFiles"
              :auto-upload="true"
              :on-preview="watchFilelist"
              :on-success="handlePreview"
              :on-remove="removeDi"
              :before-upload="beforeAvatarUpload"
              :multiple="false"
              :limit="1"
              :on-exceed="handleExceed"
              :file-list="scope.row.fileList"
            >
              <i
                class="el-icon-upload2"
                style="color: #409eff"
                @click="uploas(scope.row)"
              ></i>
            </el-upload>

            <!-- <audio :src="BASE_API+'/'+scope.row.SoundRecording"></audio> -->
          </template>
        </el-table-column>
        <el-table-column
          prop="SoundRecordingUploadTime"
          label="录音文件上传时间"
          :show-overflow-tooltip="true"
          align="center"
          min-width="150"
        ></el-table-column>
        <el-table-column min-width="120" align="center" label="自我反馈表">
          <template slot-scope="scope">
            <div v-if="scope.row.QCId">
              <el-button
                v-if="scope.row.SelfFeedbackState == 1"
                size="small"
                type="text"
                @click="handleFeedback(scope.row, 2)"
                >查看</el-button
              >
              <el-button
                style="color: #f00"
                v-else
                size="small"
                type="text"
                @click="handleFeedback(scope.row, 1)"
                >填写</el-button
              >
            </div>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column
          min-width="100"
          align="center"
          fixed="right"
          label="行动计划"
        >
          <template slot-scope="scope">
            <div v-if="scope.row.AppointState == '1'">
              <el-button
                style="color: #f00"
                size="small"
                v-if="scope.row.IsDraft == '-1'"
                type="text"
                label="去生成"
                @click="handlelAdd(scope.$index, scope.row)"
                >去生成</el-button
              >
              <span class="click_line" v-else @click="jumpMove(scope.row)">
                <span v-if="scope.row.IsDraft == 0" :style="{ color: 'red' }"
                  >去修改</span
                >
                <span v-else>已生成</span>
              </span>
            </div>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column
          min-width="80"
          fixed="right"
          align="center"
          label="CRF"
        >
          <template slot-scope="scope">
            <div v-if="scope.row.AppointState == '1'">
              <el-button
                v-if="scope.row.IsCreateCaseReport == 1"
                size="small"
                type="text"
                @click="handleTable(scope.row)"
                >查看</el-button
              >
              <el-button
                style="color: #f00"
                v-else
                size="small"
                type="text"
                @click="handleTable(scope.row)"
                >填写</el-button
              >
            </div>
            <span v-else>-</span>
          </template>
        </el-table-column>
      </el-table>
    </template>
    <!--分页-->
    <div class="block mg-20-auto pagination-fixed">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="pageId"
        :page-sizes="[10, 20, 30, 40, 80, 100, 200, 500]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      ></el-pagination>
    </div>
    <el-dialog
      title="选择以往行动计划"
      :visible.sync="dialogForm2"
      width="80%"
      :close-on-click-modal="false"
    >
      <!---->
      <template>
        <el-table
          :data="tableDataQ"
          border
          v-loading="loadingQ"
          ref="singleTable"
          @selection-change="singleChange"
          element-loading-text="加载中"
          style="width: 100%"
        >
          <el-table-column type="selection" width="55"></el-table-column>
          <el-table-column
            prop="Title"
            label="行动计划题目"
            :show-overflow-tooltip="true"
            align="center"
            min-width="120"
          ></el-table-column>
          <el-table-column
            prop="CreateTime"
            label="创建时间"
            :show-overflow-tooltip="true"
            align="center"
            min-width="100"
          ></el-table-column>
          <el-table-column
            prop="Q2_1"
            label="SMARTER目标"
            :show-overflow-tooltip="true"
            align="center"
            min-width="200"
          ></el-table-column>
          <el-table-column
            prop="PlanType"
            label="分类"
            :show-overflow-tooltip="true"
            align="center"
            min-width="60"
          ></el-table-column>
          <el-table-column
            prop="PlanCreater"
            label="创建人"
            :show-overflow-tooltip="true"
            align="center"
            min-width="60"
          ></el-table-column>
          <el-table-column
            prop="IsDraft"
            label="状态"
            :show-overflow-tooltip="true"
            :formatter="UserStateFilter_move"
            align="center"
            min-width="60"
          ></el-table-column>
          <el-table-column
            prop="Result"
            label="结果评估"
            align="center"
            :formatter="ResultFilter"
            min-width="100"
          ></el-table-column>
        </el-table>
      </template>
      <!--分页-->
      <div class="block mg-20-auto">
        <el-pagination
          @size-change="handleSizeChangeQ"
          @current-change="handleCurrentChangeQ"
          :current-page.sync="pageIdQ"
          :page-sizes="[5, 10, 20, 30]"
          :page-size="pageSizeQ"
          layout="total, sizes, prev, pager, next, jumper"
          :total="totalQ"
        ></el-pagination>
        <el-button style="float: right" type="primary" @click="makeSurecopy"
          >确认复制</el-button
        >
      </div>
    </el-dialog>
    <el-dialog
      title="生成行动计划"
      width="60%"
      :visible.sync="dialogForm1"
      :append-to-body="true"
      top="0"
      :close-on-click-modal="false"
    >
      <div style="margin-right: 20px; overflow-x: hidden">
        <p style="margin-bottom: 15px; font-weight: bold">
          研究对象：{{ formPoint.Surname }}({{ formPoint.ResearchNo }})
          <span style="padding-left: 15px"
            >研究阶段：{{ formPoint.Period | PeriodFilters }}</span
          >
          <span style="padding-left: 15px"
            >手机号：{{ formPoint.Mobile | mobileFilter }}</span
          >
        </p>
        <div class="formX">
          <span
            style="
              color: #2da3fb;
              margin-bottom: 5px;
              display: inline-block;
              cursor: pointer;
            "
            @click="copyMove"
            >复制以往行动计划</span
          >
          <div style="margin: 10px 0px" v-if="formPoint.Period == '3'">
            <label>参与者</label>
            <el-select
              style="display: inline-block; width: 200px; margin-left: 10px"
              @change="changeOther"
              v-model="formx.FeedbackPerson"
            >
              <el-option value="1" label="研究对象自己"></el-option>
              <el-option value="2" label="研究对象丈夫/伴侣"></el-option>
              <el-option value="3" label="研究对象母亲"></el-option>
              <el-option value="4" label="研究对象父亲"></el-option>
              <el-option value="5" label="研究对象公公"></el-option>
              <el-option value="6" label="研究对象婆婆"></el-option>
              <el-option value="7" label="其他"></el-option>
            </el-select>
            <el-input
              style="display: inline-block; width: 355px; margin-left: 10px"
              v-if="formx.FeedbackPerson == 7"
              v-model="formx.FeedbackOther"
              placeholdyer="请输入具体内容"
            ></el-input>
          </div>
          <div class="top">
            <label>题&nbsp;&nbsp;目</label>
            <el-input
              placeholder="请输入内容"
              v-model="formx.Title"
              style="
                display: inline-block;
                width: 570px !important;
                margin-left: 15px;
              "
              clearable
            ></el-input>
          </div>
          <div class="top">
            <label>类&nbsp;&nbsp;别</label>
            <el-select
              v-if="parseInt(formPoint.Period) <= 3"
              v-model="formx.PlanType"
              placeholder="请选择"
              style="
                display: inline-block;
                width: 570px !important;
                margin-left: 15px;
                margin-top: 15px;
              "
            >
              <el-option
                v-for="item in optionP"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
            <el-select
              v-else
              v-model="formx.PlanType"
              placeholder="请选择"
              style="
                display: inline-block;
                width: 570px !important;
                margin-left: 15px;
                margin-top: 15px;
              "
            >
              <el-option
                v-for="item in optionPC"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </div>
          <ul>
            <li>
              <h3>1.我目前的<span v-show="parseInt(formPoint.Period) > 2">育儿方式和孩子的健康</span>行为</h3>
              <!--<h5>当下你最想改变的行为是什么？</h5>-->
              <p>您最想优先考虑的<span v-show="parseInt(formPoint.Period) > 2">孩子行为和育儿方式</span>是什么?</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder
                v-model="formx.Q1"
              ></el-input>
            </li>
            <li>
              <h3>2.我的SMARTER<span v-show="parseInt(formPoint.Period) > 2">育儿</span>目标</h3>
              <p>S具体的(您具体想要达到什么目标?)</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder
                v-model="formx.Q2_1"
              ></el-input>
              <p>M可衡量的(强度?频率? 时长?每天/周多少次?)</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder
                v-model="formx.Q2_2"
              ></el-input>
              <p>A易行的 (你将采取什么精确的行动?)</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder
                v-model="formx.Q2_3"
              ></el-input>
              <p>R实际的(为达到你易行的<span v-show="parseInt(formPoint.Period) > 2">育儿</span>目标，你第一步要做什么?)</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder
                v-model="formx.Q2_4"
              ></el-input>
              <p>T定时的 (完成你<span v-show="parseInt(formPoint.Period) > 2">育儿</span>目标的时刻表?)</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder
                v-model="formx.Q2_5"
              ></el-input>
              <p>E可评估的(你如何评估你的<span v-show="parseInt(formPoint.Period) > 2">育儿</span>目标完成情况?)</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder
                v-model="formx.Q2_6"
              ></el-input>
              <p>R可修改的(你什么时候可以回顾你的<span v-show="parseInt(formPoint.Period) > 2">育儿</span>目标并计划未来的任何变化？)</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder
                v-model="formx.Q2_7"
              ></el-input>
              <p>你的SMARTER<span v-show="parseInt(formPoint.Period) > 2">育儿</span> 目标是</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder
                v-model="formx.Q2_8"
              ></el-input>
            </li>
            <li>
              <h3>3.我的主要障碍是</h3>
              <p>哪些事是阻止你达成目标的障碍? 请列举2-3个障碍。</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder="①"
                v-model="formx.Q3_1"
              ></el-input>
              <p></p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder="②"
                v-model="formx.Q3_2"
              ></el-input>
              <p></p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder="③"
                v-model="formx.Q3_3"
              ></el-input>
            </li>
            <li>
              <h3>4.我将采取的行动</h3>
              <p>你可以做些什么来克服你的障碍?</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder="①"
                v-model="formx.Q4_1"
              ></el-input>
              <p></p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder="②"
                v-model="formx.Q4_2"
              ></el-input>
              <p></p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder="③"
                v-model="formx.Q4_3"
              ></el-input>
            </li>
            <li>
              <h3>5. 我需要的资源</h3>
              <p>什么资源可以帮助你克服障碍，实现<span v-show="parseInt(formPoint.Period) > 2">育儿</span>目标?</p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder="①"
                v-model="formx.Q5_1"
              ></el-input>
              <p></p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder="②"
                v-model="formx.Q5_2"
              ></el-input>
              <p></p>
              <el-input
                type="textarea"
                :rows="1"
                placeholder="③"
                v-model="formx.Q5_3"
              ></el-input>
            </li>
            <li>
              <h3 v-show="parseInt(formPoint.Period) < 3">6.我的自信程度</h3>
              <h3 v-show="parseInt(formPoint.Period) > 2">您对实现您的育儿目标有多大信心</h3>
              <p>你对自己达到目标有多大信心?</p>
              <p style>
                <el-rate
                  v-model="formx.Q6"
                  style="margin: 30px auto 30px 10px"
                  :colors="['#99A9BF', '#F7BA2A', '#FF9900']"
                  :texts="showtexts"
                  @change="formXQ6"
                  show-text
                ></el-rate>
              </p>
            </li>
            <li>
              <h3>7.<span v-show="parseInt(formPoint.Period) > 2">育儿</span>目标的重要程度?</h3>
              <p>达到目标对你来说有多重要?</p>
              <p style>
                <el-rate
                  v-model="formx.Q7"
                  style="margin: 30px auto 30px 10px"
                  :colors="['#99A9BF', '#F7BA2A', '#FF9900']"
                  :texts="showtexts2"
                  show-text
                ></el-rate>
              </p>
            </li>
          </ul>
        </div>
      </div>
      <div class="dialog-footer">
        <el-button @click="dialogForm1 = false">取 消</el-button>
        <el-button @click="submitForm(0)">保存草稿</el-button>
        <el-button type="primary" @click="submitForm(1)" :disabled="subDisabled"
          >提交</el-button
        >
      </div>
    </el-dialog>
    <!--案例报告表  oneStep-->
    <el-dialog
      title="健康访谈CRF"
      :visible.sync="dialogFormAnli"
      :append-to-body="true"
      top="0"
      width="60%"
      :close-on-click-modal="false"
    >
      <div style="margin-right: 20px; overflow-x: hidden">
        <p style="margin-bottom: 15px; font-weight: bold">
          研究对象：{{ formPoint.Surname }}({{ formPoint.ResearchNo }})
          <span style="padding-left: 15px"
            >研究阶段：{{ formPoint.Period | PeriodFilters }}</span
          >
          <span style="padding-left: 15px"
            >手机号：{{ formPoint.Mobile | mobileFilter }}</span
          >
        </p>
        <p style="padding: 10px 0px">
          事项标题：{{ formPoint.ScheduleName }}
          <span style="padding-left: 10px"
            >计划访谈类型：{{
              formPoint.FollowUpType | FollowUpTypeFilter
            }}</span
          >
        </p>
        <p>
          预约时间：{{ formPoint.FollowUpDate }}
          <span>{{ formPoint.FollowUpTime }}</span>
        </p>
        <el-form
          :model="FormAnli"
          :rules="rules1"
          label-position="left"
          ref="FormAnli"
          label-width="70%"
          class="demo-ruleForm"
        >
          <el-form-item label="预计时长" prop="AppointLengthOfTime">
            <el-select
              v-model="FormAnli.AppointLengthOfTime"
              placeholder="请选择"
              clearable
            >
              <el-option label="20分钟" value="1"></el-option>
              <el-option label="45分钟" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="计划访谈类型">
            <span>{{ FormAnli.PlanFollowUpType | FollowUpTypeFilter }}</span>
           
          </el-form-item>
          <el-form-item label="实际访谈类型" prop="FollowUpType">
            <el-select
              v-model="FormAnli.FollowUpType"
              placeholder="请选择"
              clearable
            >
              <el-option label="面对面" value="1"></el-option>
              <el-option label="电话" value="2"></el-option>
              <el-option label="微信视频" value="3"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="是否为CH1至CH2的过渡访谈" v-if="formPoint.Period > 2">
            <el-select
              v-model="FormAnli.IsCH1ToCh2"
              placeholder="请选择"
              clearable
            >
             <el-option label="是" value="1"></el-option>
             <el-option label="否" value="2"></el-option>
            </el-select>
          </el-form-item>
          <p class="formPlebek">在访谈之前</p>
          <el-form-item label="健康现况表更新?" prop="IsUpdateRiskFactor">
            <el-select
              v-model="FormAnli.IsUpdateRiskFactor"
              placeholder="请选择"
              clearable
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="体重增长曲线确认" prop="IsConfirmWeightCurve">
            <el-select
              v-model="FormAnli.IsConfirmWeightCurve"
              placeholder="请选择"
              clearable
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="审阅《习惯养成记录》了吗？" prop="IsViewHabit">
            <el-select
              v-model="FormAnli.IsViewHabit"
              placeholder="请选择"
              clearable
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="审阅《现在怎么样了》了吗？" prop="IsViewNow">
            <el-select
              v-model="FormAnli.IsViewNow"
              placeholder="请选择"
              clearable
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="和研究对象联系了吗？" prop="IsContact">
            <el-select
              v-model="FormAnli.IsContact"
              placeholder="请选择"
              clearable
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="2"></el-option>
            </el-select>
          </el-form-item>
          <p class="formPlebek">访谈中</p>
          <el-form-item label="健康访谈开始时间" prop="FollowUpDoTime">
            <el-time-picker
              v-model="FormAnli.FollowUpDoTime"
              value-format="HH:mm"
              @change="followTimes"
              format="HH:mm"
              placeholder="请选择"
            ></el-time-picker>
          </el-form-item>
          <el-form-item
            label="谁陪研究对象一起来做健康访谈的？"
            prop="Companions"
          >
            <el-checkbox-group v-model="Companions" @change="changeCops">
              <el-checkbox label="研究对象自己"></el-checkbox>
              <el-checkbox label="丈夫/伴侣"></el-checkbox>
              <el-checkbox label="母亲"></el-checkbox>
              <el-checkbox label="婆婆"></el-checkbox>
              <el-checkbox label="父亲"></el-checkbox>
              <el-checkbox label="公公"></el-checkbox>
              <el-checkbox label="孩子"></el-checkbox>
              <el-checkbox label="其他"></el-checkbox>
            </el-checkbox-group>
            <el-input
              v-if="Companions.indexOf('其他') > -1"
              v-model="FormAnli.CompanionsOther"
              placeholder="请输入内容"
            ></el-input>
          </el-form-item>
          <div style="position: relative">
            <el-form-item :label="formPoint.Period > 2 ? '给研究对象测量身高、体重了吗?' : '您给研究对象称重了吗'" prop="IsWeightFor">
              <el-select
                v-model="FormAnli.IsWeightFor"
                placeholder="请选择"
                clearable
              >
                <el-option label="是" value="1"></el-option>
                <el-option label="否" value="2"></el-option>
              </el-select>
            </el-form-item>
           
          </div>
          <el-form-item
            label="《生活方式》填了吗 ?"
            prop="IsFillInLifeStyle"
          >
            <el-select
              v-model="FormAnli.IsFillInLifeStyle"
              placeholder="请选择"
              clearable
            >
              <el-option label="在家填的" value="1"></el-option>
              <el-option label="N/A" value="2"></el-option>
              <el-option label="访谈过程中填" value="3"></el-option>
               <el-option label="未完成" value="4"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label="《教养方式问卷》填了吗 ?"
            prop="IsFillInEducationStyle"
            v-if="formPoint.Period  == 4"
          >
            <el-select
              v-model="FormAnli.IsFillInEducationStyle"
              placeholder="请选择"
              clearable
            >
              <el-option label="在家填的" value="1"></el-option>
              <el-option label="N/A" value="2"></el-option>
              <el-option label="访谈过程中填" value="3"></el-option>
               <el-option label="未完成" value="4"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label="与研究对象一起回顾《生活方式问卷》了吗 ?"
            prop="IsReviewLifeStyle"
          >
            <el-select
              v-model="FormAnli.IsReviewLifeStyle"
              placeholder="请选择"
              clearable
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label="研究对象达到预期的目标了吗？"
            prop="IsCompleteTarget"
          >
            <el-select
              v-model="FormAnli.IsCompleteTarget"
              placeholder="请选择"
              clearable
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="进展中" value="2"></el-option>
              <el-option label="否" value="3"></el-option>
              <el-option label="N/A" value="4"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label="SMARTER GOAL行动计划制定完成?"
            prop="IsDoneSmarter"
          >
            <el-select
              v-model="FormAnli.IsDoneSmarter"
              placeholder="请选择"
              clearable
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="2"></el-option>
              <el-option label="部分" value="3"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label="访谈过程中大多数时间是谁在说话?"
            prop="WhoTalkMore"
          >
            <el-select
              v-model="FormAnli.WhoTalkMore"
              placeholder="请选择"
              clearable
            >
              <el-option label="我" value="1"></el-option>
              <el-option label="研究对象" value="2"></el-option>
              <el-option label="一样多" value="3"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="开放式提问用的时间？" prop="OpenQuestionTime">
            <el-select
              v-model="FormAnli.OpenQuestionTime"
              placeholder="请选择"
              clearable
            >
              <el-option label="<一半" value="1"></el-option>
              <el-option label="=一半" value="2"></el-option>
              <el-option label=">一半" value="3"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label="研究对象SAMRTER目标达成难易程度？"
            prop="SmarterTargerDifficultLevel"
          >
            <el-select
              v-model="FormAnli.SmarterTargerDifficultLevel"
              placeholder="请选择"
              clearable
            >
              <el-option label="很简单" value="1"></el-option>
              <el-option label="简单" value="2"></el-option>
              <el-option label="一般" value="3"></el-option>
              <el-option label="困难" value="4"></el-option>
              <el-option label="很困难" value="5"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="研究对象的积极性" prop="Enthusiasm">
            <el-select
              v-model="FormAnli.Enthusiasm"
              placeholder="请选择"
              clearable
            >
              <el-option label="高" value="1"></el-option>
              <el-option label="一般" value="2"></el-option>
              <el-option label="低" value="3"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="转诊至肥胖门诊?" >
            <el-select
              v-model="FormAnli.IsToFatClinic"
              placeholder="请选择"
              clearable
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="转诊给营养师？">
            <el-select
              v-model="FormAnli.IsToNutriClinic"
              placeholder="请选择"
              clearable
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="安排下一次访谈的时间?" prop="IsConfirmNextTime">
            <el-select
              v-model="FormAnli.IsConfirmNextTime"
              placeholder="请选择"
              clearable
            >
              <el-option label="是" value="1"></el-option>
              <el-option label="否" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="健康访谈结束时间" prop="FollowUpOverTime">
            <el-time-picker
              v-model="FormAnli.FollowUpOverTime"
              clearable
              @change="followTimes"
              value-format="HH:mm"
              format="HH:mm"
              placeholder="请选择"
            ></el-time-picker>
          </el-form-item>
          <el-form-item
            label="无效访谈原因"
            v-if="InvalidReason"
            prop="InvalidReason"
          >
            <el-input
              type="textarea"
              v-model="FormAnli.InvalidReason"
            ></el-input>
          </el-form-item>
          <p class="formPlebek">访谈后</p>
          <el-form-item label="你对此次健康访谈的满意度" prop="Satisfaction">
            <el-select
              v-model="FormAnli.Satisfaction"
              placeholder="请选择"
              clearable
            >
              <el-option label="满意" value="1"></el-option>
              <el-option label="一般" value="2"></el-option>
              <el-option label="不满意" value="3"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label="下一次健康访谈你有什么建议以及下一次健康访谈你想讨论的内容？"
            prop="AdviceAndDiscussContent"
            class="aloneItem"
          >
            <el-input
              type="textarea"
              v-model="FormAnli.AdviceAndDiscussContent"
              placeholder="限500字"
            ></el-input>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button
          v-if="RoleGroup == 1 && hasCount"
          @click="deleteCrf"
          style="float: left"
          >删除</el-button
        >
        <el-button @click="dialogFormAnli = false">取 消</el-button>
        <el-button type="primary" @click="tableSure('FormAnli')"
          >保存</el-button
        >
      </div>
    </el-dialog>

    <!---->
    <el-dialog
      title="自我反馈表"
      :visible.sync="dialogForm6"
      :append-to-body="true"
      class="asd"
      top="0"
      width="60%"
      :close-on-click-modal="false"
    >
      <div style="margin-right: 20px">
        <el-form
          :model="formFeedback"
          :rules="rules6"
          label-position="left"
          ref="formFeedback"
          label-width="0"
          class="demo-ruleForm"
        >
          <div class="formScore">
            <ul>
              <li>
                <h3><span style="color:#f00">*</span>1.你觉得访谈进行得怎么样？</h3>
                <el-form-item label-width="" label="" prop="HowInterview">
                  <el-input
                    type="textarea"
                    style="margin-top: 15px; margin-bottom: 20px"
                    :rows="5"
                    placeholder="限500字"
                    v-model="formFeedback.HowInterview"
                  >
                  </el-input>
                </el-form-item>
              </li>
              <li>
                <h3><span style="color:#f00">*</span>2.能够轻松地询问开放探索式问题吗？</h3>
                <el-form-item label-width="" label="" prop="AskEasily">
                  <el-input
                    type="textarea"
                    style="margin-top: 15px; margin-bottom: 20px"
                    :rows="5"
                    placeholder="限500字"
                    v-model="formFeedback.AskEasily"
                  >
                  </el-input>
                </el-form-item>
              </li>
              <li>
                <h3><span style="color:#f00">*</span>3.访谈的什么部分进行得顺利？</h3>
                <el-form-item label-width="" label="" prop="SmoothPart">
                  <el-input
                    type="textarea"
                    style="margin-top: 15px; margin-bottom: 20px"
                    :rows="5"
                    placeholder="限500字"
                    v-model="formFeedback.SmoothPart"
                  >
                  </el-input>
                </el-form-item>
              </li>
              <li>
                <h3><span style="color:#f00">*</span>4.你认为你什么地方可以做得更好？</h3>
                <el-form-item label-width="" label="" prop="DoBetter">
                  <el-input
                    type="textarea"
                    style="margin-top: 15px; margin-bottom: 20px"
                    :rows="5"
                    placeholder="限500字"
                    v-model="formFeedback.DoBetter"
                  >
                  </el-input>
                </el-form-item>
              </li>
              <li>
                <h3><span style="color:#f00">*</span>5.你可以做什么来支持他人进行改变？</h3>
                <el-form-item label-width="" label="" prop="DoChange">
                  <el-input
                    type="textarea"
                    style="margin-top: 15px; margin-bottom: 20px"
                    :rows="5"
                    placeholder="限500字"
                    v-model="formFeedback.DoChange"
                  >
                  </el-input>
                </el-form-item>
              </li>
              <div v-if="dataObj.Period == '4'">

             
              <li >
                <h3><span style="color:#f00">*</span>6.您是否使用了本次访谈的提示表? </h3>
                <el-form-item label-width="" label="" prop="UseTips">
                  <el-radio-group v-model="formFeedback.UseTips">
                    <el-radio label="1">是</el-radio>
                    <el-radio label="0">否</el-radio>
                  </el-radio-group>
                </el-form-item>
              </li>
              <li v-show="formFeedback.UseTips == '0'">
                <h3><span style="color:#f00">*</span>7a. 如果否 – 您为什么没有使用提示表? </h3>
                <el-form-item label-width="" label="" >
                  <el-checkbox-group v-model="formFeedback.UseTipsNo">
                    <el-checkbox label="1">我记住了很多提示</el-checkbox>
                    <el-checkbox label="2">我可以借鉴自己的经验</el-checkbox>
                    <el-checkbox label="3">我没有时间</el-checkbox>
                    <el-checkbox label="4">我不觉得它们有用</el-checkbox>
                    <el-checkbox label="5">其他原因，请说明: </el-checkbox>
                  </el-checkbox-group>
                  <el-input
                    v-if="formFeedback.UseTipsNo && formFeedback.UseTipsNo.indexOf('5') >-1"
                    style="width: 150px"
                    placeholder="其他原因，请说明"
                    size="small"
                    v-model="formFeedback.UseTipsNoReason"
                  >
                  </el-input>
                </el-form-item>
              </li>
              <li v-show="formFeedback.UseTips == '1'">
                <h3>7b. 如果是 – 指出您在本课程中是否以以下任何方式使用了提示表</h3>
                <div style="padding-left:25px">
                <el-form-item label-width="80%" label="我在本节课前复习了提示，以做好准备:" >
                  <el-radio-group v-model="formFeedback.UseTipsYesReview" style="display:flex">
                    <el-radio label="1">是</el-radio>
                    <el-radio label="0">否</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label-width="80%" label="我在本节课中使用了这些技巧来获得想法或向家长提出想法:">
                  <el-radio-group v-model="formFeedback.UseTipsYesSkill" style="display:flex">
                    <el-radio label="1">是</el-radio>
                    <el-radio label="0">否</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label-width="80%" label="之后，我使用了提示表，看看在本次会议中我可以说什么或建议什么:">
                  <el-radio-group v-model="formFeedback.UseTipsYesAdvice" style="display:flex">
                    <el-radio label="1">是</el-radio>
                    <el-radio label="0">否</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label-width="80%" label="其他方式:">
                  <el-radio-group v-model="formFeedback.UseTipsYesOther" style="display:flex">
                    <el-radio label="1">是</el-radio>
                    <el-radio label="0">否</el-radio>
                  </el-radio-group>
                  <el-input
                  v-if="formFeedback.UseTipsYesOther == '1'"
                    style="width: 150px"
                    placeholder="请说明"
                    size="small"
                    v-model="formFeedback.UseTipsYesOtherDetail"
                  >
                  </el-input>
                </el-form-item>
                </div>
              </li>
              <li>
                <h3><span style="color:#f00">*</span>8. 在本课程中提供育儿实践指导有多困难?</h3>
                <el-form-item label-width="" label="" prop="Difficulty">
                  <el-radio-group v-model="formFeedback.Difficulty" style="display:block">
                    <el-radio label="1">容易</el-radio>
                    <el-radio label="2">还行/可以的 </el-radio>
                    <el-radio label="3">困难</el-radio>
                  </el-radio-group>
                   <el-input
                    type="textarea"
                    style="margin-top: 15px; margin-bottom: 20px"
                    :rows="5"
                    placeholder="解释您的答案:"
                    size="small"
                    v-model="formFeedback.DifficultyAnswer"
                  >
                  </el-input>
                </el-form-item>
              </li>
              <li>
                <h3><span style="color:#f00">*</span>9. 接受更多的培训和/或与父母进行更多的练习是否有助于您提供相关的育儿指导? </h3>
                <el-form-item label-width="" label="" prop="Train">
                  <el-radio-group v-model="formFeedback.Train" style="display:flex;flex-direction:column">
                    <el-radio label="1">更多的培训对我有帮助。请具体说明您需要什么: </el-radio>
                    <el-input
                    v-if="formFeedback.Train == '1'"
                    type="textarea"
                    style="margin-top: 15px; margin-bottom: 20px"
                    :rows="2"
                    placeholder="请具体说明您需要什么: "
                    size="small"
                    v-model="formFeedback.TrainRequirement"
                  >
                  </el-input>
                    <el-radio label="2">多和学员一起练习和/或多花点时间复习所收到的培训材料会对我有帮助。</el-radio>
                    <el-radio label="3">更多的培训和与参与者的练习都会对我有帮助。请具体说明您对培训的需求:</el-radio>
                  </el-radio-group>
                   <el-input
                    v-if="formFeedback.Train == '3'"
                    type="textarea"
                    style="margin-top: 15px; margin-bottom: 20px"
                    :rows="2"
                    placeholder="请具体说明您对培训的需求:"
                    size="small"
                    v-model="formFeedback.TrainRequirement"
                  >
                  </el-input>
                </el-form-item>
              </li>
              <li>
                <h3><span style="color:#f00">*</span>10. 提示表是否有助于提供相关的育儿指导，或者您是否需要更多的工具来提供更好的育儿指导?</h3>
                <el-form-item label-width="" label="" prop="Helpful">
                  <el-radio-group v-model="formFeedback.Helpful" style="display:flex;flex-direction:column">
                    <el-radio label="1">我需要多练习使用这些技巧</el-radio>
                    <el-radio label="2">我需要更多的工具。请说明您需要什么工具:</el-radio>
                    <el-input
                    type="textarea"
                     v-if="formFeedback.Helpful == '2'"
                    style="margin-top: 15px; margin-bottom: 20px"
                    :rows="2"
                    placeholder="请说明您需要什么工具: "
                    size="small"
                    v-model="formFeedback.HelpfulTool"
                  >
                  </el-input>
                    <el-radio label="3">我需要更多的练习使用技巧和更多的工具。请说明您需要什么工具：</el-radio>
                  </el-radio-group>
                  <el-input
                    type="textarea"
                     v-if="formFeedback.Helpful == '3'"
                    style="margin-top: 15px; margin-bottom: 20px"
                    :rows="2"
                    placeholder="请说明您需要什么工具: "
                    size="small"
                    v-model="formFeedback.HelpfulTool"
                  >
                  </el-input>
                </el-form-item>
              </li>
               </div>
              <li>
                <h3><span style="color:#f00">*</span>下次你的访谈会有什么不同？</h3>
                <el-form-item label-width="" label="" prop="NextDifferent">
                  <el-input
                    type="textarea"
                    style="margin-top: 15px; margin-bottom: 20px"
                    :rows="5"
                    placeholder="限500字"
                    v-model="formFeedback.NextDifferent"
                  >
                  </el-input>
                </el-form-item>
              </li>
              <li>
                <p>
                  <span style="color:#f00">*</span>当你与他人进行关于健康生活习惯的谈话时，你有多自信？（例如：健康饮食，健康运动）（1代表一点也不自信；10代表非常自信）
                </p>
                <el-form-item label-width="" label="" prop="ConfidenceLevel">
                  <el-slider
                    v-model="formFeedback.ConfidenceLevel"
                    :step="1"
                    height="30"
                    input-size="large"
                    :max="10"
                    :min="0"
                    show-stops
                  >
                  </el-slider>
                </el-form-item>
              </li>
              <li>
                <p>
                  <span style="color:#f00">*</span>对你来说，帮助他人改变他们的生活习惯有多重要？（1代表一点也不重要；10代表非常重要）
                </p>
                <el-form-item label-width="" label="" prop="Importance">
                  <!-- <el-rate
                    v-model="formFeedback.Importance"
                    :max="10"
                    >
                  </el-rate> -->
                  <el-slider
                    v-model="formFeedback.Importance"
                    :step="1"
                    height="30"
                    input-size="large"
                    :max="10"
                    :min="0"
                    show-stops
                  >
                  </el-slider>
                </el-form-item>
              </li>
            </ul>
          </div>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button
          @click="removeReport"
          v-if="RoleGroup == 1 || (dataObj.NurseId == token && (formFeedback.CreateTime ||'').substring(0,10) == dateForm(new Date))"
          class="pull-left"
          type="danger"
          >删 除</el-button
        >
        <el-button @click="dialogForm6 = false">取 消</el-button>
        <el-button type="primary"  v-if="!formFeedback.CreateTime || RoleGroup == 1 || (dataObj.NurseId == token && (formFeedback.CreateTime ||'').substring(0,10) == dateForm(new Date))" @click="submitFeedback('formFeedback')"
          >保 存</el-button
        >
      </div>
    </el-dialog>

    <!--健康访谈人员自我报告问卷-->
    <el-dialog
      title="健康访谈人员自我报告问卷"
      :visible.sync="dialogForm9"
      :append-to-body="true"
      class="asd"
      top="0"
      width="60%"
      :close-on-click-modal="false"
    >
      <div style="margin-right: 20px">
        <el-form
          :model="formQues"
          :rules="rules7"
          label-position="left"
          ref="formQues"
          label-width="0"
          class="demo-ruleForm"
        >
          <div class="formScore">
            <p style="text-align: center; margin: 10px 0px">
              这份问卷旨在了解您对健康访谈技巧和对生命树项目研究对象运用健康访谈技巧的经验和认知。
            </p>
            <p style="text-align: center; margin: 10px 0px">
              对下列问题，请您勾选适用的选项。回答没有对错之分。这份问卷大约需要10分钟完成。
            </p>
            <!-- <p style="text-align: center; margin: 10px 0px; color: #409eff">
              （请注意生命树项目需要您在两个时间点的反馈，这是第二次也是最后一次的反馈。）
            </p> -->
            <h5 style="text-align: center; margin: 20px 0px; font-size: 16px">
              您的生命树项目经验
            </h5>
            <ul>
              <li>
                <h5 style="margin: 10px 0px; font-size: 14px">关于您自己</h5>
                <el-form-item label-width="100px" label="我是" prop="">
                  <el-radio-group v-model="formQues.DoctorType">
                    <el-radio label="1">护士</el-radio>
                    <el-radio label="2">内科医生</el-radio>
                    <el-radio label="3">儿科医生</el-radio>
                    <el-radio label="4">家庭医生</el-radio>
                    <el-radio label="5">其他</el-radio>
                  </el-radio-group>
                  <el-input
                    style="width: 150px"
                    placeholder="限10字"
                    size="small"
                    v-model="formQues.DoctorType_Other"
                  >
                  </el-input>
                </el-form-item>
                <h3 style="margin-top: 20px">
                  我进行健康访谈干预在(勾选所有适用的选项)：
                </h3>
                <el-form-item label-width="" label="" prop="">
                  <el-checkbox-group v-model="formQues.Periods">
                    <el-checkbox label="1">孕前期</el-checkbox>
                    <el-checkbox label="2">怀孕期</el-checkbox>
                    <el-checkbox label="3">产后阶段</el-checkbox>
                  </el-checkbox-group>
                </el-form-item>
                <el-form-item
                  label-width="300px"
                  label="1.您认为您的角色对帮助研究对象获得健康的生活方式习惯有多重要?"
                  prop=""
                >
                  <el-radio-group v-model="formQues.Importance">
                    <el-radio label="1">一点也不</el-radio>
                    <el-radio label="2">一点点</el-radio>
                    <el-radio label="3">一般</el-radio>
                    <el-radio label="4">非常</el-radio>
                    <el-radio label="5">极其</el-radio>
                  </el-radio-group>
                </el-form-item>
                <p style="color: #999; margin: 10px 0px">
                  我们想知道对您来说，对研究对象使用“健康访谈技巧”的难易程度。“技巧”指访谈中的开放探索性问题(ODQs)。
                </p>
                <h3 style="margin-top: 30px; margin-bottom: 20px">
                  2.下列问题，请勾选最适用的选项
                </h3>
                <div class="parentDiv">
                  <table ref="tableDom">
                    <tr>
                      <td style="min-width: 250px">我不能使用技巧因为...</td>
                      <td>强烈同意</td>
                      <td>同意</td>
                      <td>不确定</td>
                      <td>不同意</td>
                      <td>非常不同意</td>
                    </tr>
                    <tr>
                      <td class="pdl">a.研究对象不喜欢</td>
                      <td
                        v-for="item in 5"
                        :key="item"
                        :class="{ active: formQues.Reason_a == item }"
                        width="100"
                        style="cursor: pointer"
                        @click="getBub($event, item, 'Reason_a')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                    <tr>
                      <td class="pdl">b.这使与研究对象交流变困难</td>
                      <td
                        v-for="item in 5"
                        :key="item"
                        width="100"
                        :class="{ active: formQues.Reason_b == item }"
                        style="cursor: pointer"
                        @click="getBub($event, item, 'Reason_b')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                    <tr>
                      <td class="pdl">c.和某些研究对象的关系有点微妙</td>
                      <td
                        v-for="item in 5"
                        :key="item"
                        width="100"
                        :class="{ active: formQues.Reason_c == item }"
                        style="cursor: pointer"
                        @click="getBub($event, item, 'Reason_c')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                    <tr>
                      <td class="pdl">d.我不知道如何合理地运用技巧</td>
                      <td
                        v-for="item in 5"
                        :key="item"
                        width="100"
                        :class="{ active: formQues.Reason_d == item }"
                        style="cursor: pointer"
                        @click="getBub($event, item, 'Reason_d')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                    <tr>
                      <td class="pdl">e.不知道该怎么做</td>
                      <td
                        v-for="item in 5"
                        width="100"
                        :key="item"
                        style="cursor: pointer"
                        :class="{ active: formQues.Reason_e == item }"
                        @click="getBub($event, item, 'Reason_e')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                    <tr>
                      <td class="pdl">f.我不确定这些技巧是否有帮助</td>
                      <td
                        v-for="item in 5"
                        width="100"
                        :key="item"
                        style="cursor: pointer"
                        :class="{ active: formQues.Reason_f == item }"
                        @click="getBub($event, item, 'Reason_f')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                    <tr>
                      <td class="pdl">g.这些技巧看起来似乎和访谈没有关联</td>
                      <td
                        v-for="item in 5"
                        :key="item"
                        width="100"
                        :class="{ active: formQues.Reason_g == item }"
                        style="cursor: pointer"
                        @click="getBub($event, item, 'Reason_g')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                    <tr>
                      <td class="pdl">h.我不确信这样做是对的</td>
                      <td
                        v-for="item in 5"
                        :key="item"
                        width="100"
                        :class="{ active: formQues.Reason_h == item }"
                        style="cursor: pointer"
                        @click="getBub($event, item, 'Reason_h')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                    <tr>
                      <td class="pdl">i.我没有足够的时间</td>
                      <td
                        v-for="item in 5"
                        :key="item"
                        width="100"
                        :class="{ active: formQues.Reason_i == item }"
                        style="cursor: pointer"
                        @click="getBub($event, item, 'Reason_i')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                    <tr>
                      <td class="pdl">j.我没有找到机会用</td>
                      <td
                        v-for="item in 5"
                        :key="item"
                        width="100"
                        :class="{ active: formQues.Reason_j == item }"
                        style="cursor: pointer"
                        @click="getBub($event, item, 'Reason_j')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                    <tr>
                      <td class="pdl">k.我太忙或太累了</td>
                      <td
                        v-for="item in 5"
                        :key="item"
                        width="100"
                        :class="{ active: formQues.Reason_k == item }"
                        style="cursor: pointer"
                        @click="getBub($event, item, 'Reason_k')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                    <tr>
                      <td class="pdl">l.我觉得很难想起用这些技巧</td>
                      <td
                        v-for="item in 5"
                        :key="item"
                        width="100"
                        :class="{ active: formQues.Reason_l == item }"
                        style="cursor: pointer"
                        @click="getBub($event, item, 'Reason_l')"
                      >
                        {{ item }}
                      </td>
                    </tr>
                  </table>
                  <p style="margin-top: 30px">
                    问题3到5与下列的健康访谈技巧(HCS)有关：
                  </p>
                  <p style="margin: 10px">-运用ODQs帮助某人探索问题</p>
                  <p style="margin: 10px">-反思自己的健康访谈过程</p>
                  <p style="margin: 10px">-更多的倾听</p>
                  <p style="margin: 10px">-运用ODQs帮助某人制定SMARTER计划</p>
                  <p style="margin-top:20px">
                    3.您对运用健康访谈技巧的喜欢程度
                  </p>
                    <el-radio-group v-model="formQues.SkillLove">
                      <el-radio label="1">一点也不</el-radio>
                      <el-radio label="2">一点点</el-radio>
                      <el-radio label="3">一般</el-radio>
                      <el-radio label="4">非常</el-radio>
                      <el-radio label="5">极其</el-radio>
                    </el-radio-group>
                  <p style="margin-top: 20px">
                    4.您觉得健康访谈技巧对帮助研究对象改善生活方式习惯有多有用?
                  </p>
                    <el-radio-group v-model="formQues.Usefulness">
                      <el-radio label="1">一点也不</el-radio>
                      <el-radio label="2">一点点</el-radio>
                      <el-radio label="3">一般</el-radio>
                      <el-radio label="4">非常</el-radio>
                      <el-radio label="5">极其</el-radio>
                    </el-radio-group>
                    <p style="margin-top: 20px">
                   5.您对非生命树研究对象使用健康访谈技巧的频率
                  </p>
                    <el-radio-group v-model="formQues.Frequency">
                      <el-radio label="1">从不</el-radio>
                      <el-radio label="2">很少</el-radio>
                      <el-radio label="3">有时</el-radio>
                      <el-radio label="4">经常</el-radio>
                      <el-radio label="5">很经常</el-radio>
                    </el-radio-group>
                  <h4 style="margin-top: 20px">
                    6.对您来说，将健康访谈技巧与日常工作结合起来有多大的挑战性
                  </h4>
                  <el-form-item label-width="" label="" prop="">
                    <el-rate
                      v-model="formQues.challenge"
                      style="margin: 20px"
                      :max="10"
                      :texts="[
                        '完全没有挑战性',
                        '极少有挑战性',
                        '有一点点挑战性',
                        '很少挑战性',
                        '有点挑战性',
                        '有挑战性',
                        '一般有挑战性',
                        '经常有挑战性',
                        '时常有挑战性',
                        '非常有挑战性',
                      ]"
                      show-text
                    >
                    </el-rate>
                  </el-form-item>
                </div>
                <p>7.列出三个能让将健康访谈技巧和日常工作结合变容易的事情</p>
                <el-form-item label-width="" label="" prop="">
                  <el-input
                    style="margin: 10px 0"
                    placeholder="限100字"
                    type="textarea"
                    :rows="3"
                    v-model="formQues.EasyThing1"
                  >
                  </el-input>
                  <el-input
                    placeholder="限100字"
                    type="textarea"
                    style="margin: 10px 0"
                    :rows="3"
                    v-model="formQues.EasyThing2"
                  >
                  </el-input>
                  <el-input
                    style="margin: 10px 0"
                    placeholder="限100字"
                    type="textarea"
                    :rows="3"
                    v-model="formQues.EasyThing3"
                  >
                  </el-input>
                </el-form-item>
                <p>8.列出三个能让将健康访谈技巧和日常工作结合变困难的事情</p>
                <el-form-item label-width="" label="" prop="">
                  <el-input
                    style="margin: 10px 0"
                    placeholder="限100字"
                    type="textarea"
                    :rows="3"
                    v-model="formQues.DifficultThing1"
                  >
                  </el-input>
                  <el-input
                    placeholder="限100字"
                    type="textarea"
                    style="margin: 10px 0"
                    :rows="3"
                    v-model="formQues.DifficultThing2"
                  >
                  </el-input>
                  <el-input
                    style="margin: 10px 0"
                    placeholder="限100字"
                    type="textarea"
                    :rows="3"
                    v-model="formQues.DifficultThing3"
                  >
                  </el-input>
                </el-form-item>
                <p style="margin: 10px 0">
                  9.关于有助于将健康访谈技巧和日常工作结合的策略，您有什么建议?
                </p>
                <el-input
                  style="margin: 10px 0"
                  placeholder="限500字"
                  type="textarea"
                  :rows="3"
                  v-model="formQues.Advice"
                >
                </el-input>
                <p style="margin: 10px 0">
                  10.您对项目组提供给研究对象帮助其改善生活方式习惯的其他资源是否满意(如母乳喂
                  养热线，营养门诊，健康教育课程)?
                </p>
                <el-form-item label-width="" label="" prop="">
                  <el-radio-group v-model="formQues.Satisfaction_Team">
                    <el-radio label="1">一点也不</el-radio>
                    <el-radio label="2">一点点</el-radio>
                    <el-radio label="3">一般</el-radio>
                    <el-radio label="4">非常</el-radio>
                    <el-radio label="5">极其</el-radio>
                  </el-radio-group>
                </el-form-item>
                <p style="margin: 10px 0">
                  11.您对生命树网站帮助您进行健康访谈干预的满意程度?
                </p>
                <el-form-item label-width="" label="" prop="">
                  <el-radio-group v-model="formQues.Satisfaction_Website">
                    <el-radio label="1">一点也不</el-radio>
                    <el-radio label="2">一点点</el-radio>
                    <el-radio label="3">一般</el-radio>
                    <el-radio label="4">非常</el-radio>
                    <el-radio label="5">极其</el-radio>
                  </el-radio-group>
                </el-form-item>
                <p style="margin: 10px 0">
                  12.评估员对您访谈录音的反馈是否有助于保持或提升您的健康访谈技巧?
                </p>
                <el-form-item label-width="" label="" prop="">
                  <el-radio-group
                    v-model="formQues.Satisfaction_SoundRecording"
                  >
                    <el-radio label="1">一点也不</el-radio>
                    <el-radio label="2">一点点</el-radio>
                    <el-radio label="3">一般</el-radio>
                    <el-radio label="4">非常</el-radio>
                    <el-radio label="5">极其</el-radio>
                  </el-radio-group>
                </el-form-item>
              </li>
            </ul>
          </div>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogForm9 = false">取 消</el-button>
        <el-button type="primary" v-if="RoleGroup>2" @click="submitQyes('formQues')"
          >保 存</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
import FileSaver from "file-saver"; //导出
import {DIC_PERIODA,filterPeriod} from '@/utils/localDic'
import XLSX from "xlsx";
export default {
  data() {
    return {
      marks: {
        0: "没有挑战性",
        5: "一般",
        10: "非常有挑战性",
      },
      searchData: {
        sysId: "",
        hasDoPhysiqueMeasure: "",
        followUpHasDoPhysiqueMeasure: "",
        followUpType: "",
        appointState: "",
        actualFollowUpType: "",
        followUpState: "",
        userState: "",
        groupType: "",
        keyWord: "",
        period: "",
        districtNo: "",
        intensityOfIntervention: "",
        NurseId: "",
        communityId: "", // 社区id
        testType: "2", // 试验类型
        NurseId: "",
      },
      drawer: false,
      // districtNo:'310105',
      CtyIds: "",
      timeDate: [],
      optionDiq: [],
      optionsData: [], //社区数据
      Companions: [],
      subDisabled: false,
      dialogForm1: false,
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
      pageId: 1,
      total: null,
      loading: true,
      pageSize: 10,
      tableData: [],
      options1SJ: [
        { value: "1", label: "面对面" },
        { value: "2", label: "电话" },
        { value: "3", label: "微信视频" },
      ],
      options1JH: [
        { value: "", label: "全部" },
        { value: "1", label: "面对面" },
        { value: "2", label: "电话" },
        { value: "3", label: "面对面/电话" },
      ],
      PostFiles: actions(),
      optionPC: [
        { value: "育儿方式&营养", label: "育儿方式&营养" },
        { value: "育儿方式&身体活动", label: "育儿方式&身体活动" },
        { value: "育儿方式&睡眠", label: "育儿方式&睡眠" },
        { value: "育儿方式&视屏时间", label: "育儿方式&视屏时间" },
        { value: "其他", label: "其他" },
      ],
      optionP: [
        { value: "母乳喂养", label: "母乳喂养" },
        { value: "环境", label: "环境" },
        { value: "营养", label: "营养" },
        { value: "身体活动", label: "身体活动" },
        { value: "心理健康", label: "心理健康" },
        { value: "睡眠", label: "睡眠" },
        { value: "吸烟", label: "吸烟" },
      ],
      options1: [
        { value: "", label: "全部" },
        { value: "1", label: "面对面" },
        { value: "2", label: "电话" },
        { value: "3", label: "微信视频" },
      ],
      options5: [
        { value: "1", label: "面对面" },
        { value: "2", label: "电话" },
        { value: "", label: "面对面/电话" },
      ],
      options2: [
        { value: "", label: "全部" },
        { value: "0", label: "待确认" },
        { value: "1", label: "已确认" },
        { value: "2", label: "已取消" },
      ],
      options2s: [
        { value: "0", label: "待确认" },
        { value: "1", label: "已确认" },
        { value: "2", label: "已取消" },
      ],
      options3: [
        { value: "", label: "全部" },
        { value: "1", label: "已完成" },
        { value: "0", label: "待完成" },
        { value: "2", label: "已取消" },
        { value: "3", label: "爽约" },
      ],
      options3s: [
        { value: "1", label: "已完成" },
        { value: "0", label: "待完成" },
        { value: "2", label: "已取消" },
        { value: "3", label: "爽约" },
      ],
      options4: [
        { value: "", label: "全部" },
        { value: "1", label: "活跃" },
        { value: "2", label: "不活跃" },
      ],
      optionss6: [
        { value: "", label: "全部" },
        { value: "1", label: "A" },
        { value: "2", label: "B" },
      ],
      options6: [
        { value: "", label: "全部" },
        { value: "0", label: "预试验" },
        { value: "1", label: "正式试验" },
        { value: "2", label: "预试验+正式试验" },
      ],
      options2sp: DIC_PERIODA,
      options9: [
        { value: "", label: "全部" },
        { value: "1", label: "AA" },
        { value: "2", label: "A" },
      ],
      FollowUpTypeFilter(row, column, cellValue, index) {
        return cellValue == 1
          ? "面对面"
          : cellValue == 2
          ? "电话"
          : cellValue == 3
          ? "面对面/电话"
          : "面对面/电话";
      },
      UserStateFilter_move(row, column, cellValue, index) {
        return cellValue == 1 ? "已发送" : "草稿";
      },
      PeriodFilter(row, column, cellValue, index) {
       return filterPeriod(cellValue)
      },
      ActualFollowUpTypeFilter(row, column, cellValue) {
        if (cellValue == "1") {
          return "面对面";
        } else if (cellValue == "2") {
          return "电话";
        } else if (cellValue == "3") {
          return "微信视频";
        } else {
          return "";
        }
      },
      ResultFilter(row, column, cellValue, index) {
        switch (cellValue) {
          case "1":
            return "目标达成";
            break;
          case "2":
            return "目标部分达成";
            break;
          case "3":
            return "没有改变";
            break;
          case "4":
            return "情况更糟";
        }
      },
      DistrictNameFilter(row, column, cellValue, index) {
        return cellValue || "-";
      },
      IntensityFilter(row, column, cellValue, index) {
        return cellValue == 1 ? "AA" : "A";
      },
      AppointFilter(row, column, cellValue, index) {
        return cellValue == 1 ? "已预约" : cellValue == 0 ? "待确认" : "已取消";
      },
      FollowUpFilter(row, column, cellValue, index) {
        return cellValue == 1 ? "已完成" : "待完成";
      },
      maxHeight: "",
      formx: {
        FeedbackPerson: "1",
        FeedbackOther: "",
        Title: "",
        Q1: "",
        Q2_1: "",
        Q2_2: "",
        Q2_3: "",
        Q2_4: "",
        Q2_5: "",
        Q2_6: "",
        Q2_7: "",
        Q2_8: "",
        Q3_1: "",
        Q3_2: "",
        Q3_3: "",
        Q4_1: "",
        Q4_2: "",
        Q4_3: "",
        Q5_1: "",
        Q5_2: "",
        Q5_3: "",
        Q6: null,
        Q7: null,
        Result: null,
        IsDraft: "",
        PlanType: "",
      },
      showtexts: ["一点也没有", "", "有一点", "", "完全有信心"],
      showtexts2: ["不重要", "", "一般", "", "非常重要"],
      sysId: "",
      ResearchObjectId: "",
      ScheduleId: "",
      showActive: false,
      dialogForm2: false,
      tableDataQ: [],
      pageIdQ: 1,
      totalQ: null,
      loadingQ: true,
      SYS_IDs: "",
      pageSizeQ: 5,
      tablerow: null,
      optionsNurse: [],
      SearchoptionsNurse: [],
      copyObject: null,
      onOFFsub: false,
      GroupTypeFilter(row, column, cellValue, index) {
        return cellValue == "1" ? "A" : "B";
      },
      rules1: {
        AppointLengthOfTime: [
          { required: true, message: "必填项", trigger: "change" },
        ],
        InvalidReason: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        IsUpdateRiskFactor: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        IsConfirmWeightCurve: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        IsWeightFor: [{ trigger: "change", required: true, message: "必填项" }],
        IsFillInBehavioralSelf: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        IsDoneSmarter: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        WhoTalkMore: [{ trigger: "change", required: true, message: "必填项" }],
        OpenQuestionTime: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        SmarterTargerDifficultLevel: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        Enthusiasm: [{ trigger: "change", required: true, message: "必填项" }],
        IsConfirmNextTime: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        FollowUpOverTime: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        Satisfaction: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        FollowUpDoTime: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        AdviceAndDiscussContent: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        FollowUpType: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        IsCompleteTarget: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        IsReviewLifeStyle: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        IsFillInLifeStyle: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        IsFillInEducationStyle: [
          { trigger: "change", required: true, message: "必填项" },
        ],
        Companions: [{ trigger: "change", required: true, message: "必填项" }],
        IsContact: [{ trigger: "change", required: true, message: "必填项" }],
        IsViewNow: [{ trigger: "change", required: true, message: "必填项" }],
        IsViewHabit: [{ trigger: "change", required: true, message: "必填项" }],
        PlanFollowUpType: [
          { trigger: "change", required: true, message: "必填项" },
        ],
      },
      dialogFormAnli: false,
      FormAnli: {
        AppointLengthOfTime: "",
        IsUpdateRiskFactor: "",
        IsConfirmWeightCurve: "",
        InvalidReason:"",
        IsCH1ToCh2:"",
        PlanFollowUpType: "",
        FollowUpDoTime: "",
        IsWeightFor: "",
        IsFillInBehavioralSelf: "",
        IsDoneSmarter: "",
        WhoTalkMore: "",
        OpenQuestionTime: "",
        SmarterTargerDifficultLevel: "",
        Enthusiasm: "",
        IsConfirmNextTime: "",
        FollowUpOverTime: "",
        Satisfaction: "",
        AdviceAndDiscussContent: "",
        Companions: [],
        IsViewHabit: "",
        IsViewNow: "",
        IsContact: "",
        IsFillInLifeStyle: "",
        IsFillInEducationStyle:"",
        IsReviewLifeStyle: "",
        IsCompleteTarget: "",
        FollowUpType: "",
      },
      loadingRedcore: true,
      formPoint: {},
      dataRow: {},
      rowOff: false,
      diaLoading: true,
      hasCount: false,
      formFeedback: {
        HowInterview: "",
        UseTipsNo:[],
        UseTips:"",
        AskEasily: "",
        SmoothPart: "",
        DoBetter: "",
        DoChange: "",
        NextDifferent: "",
        ConfidenceLevel: 0,
        Importance: 0,
      },
      rules6: {
        HowInterview: [
          { required: true, message: "必填项", trigger: "change" },
        ],
        AskEasily: [{ required: true, message: "必填项", trigger: "change" }],
        SmoothPart: [{ required: true, message: "必填项", trigger: "change" }],
        DoBetter: [{ required: true, message: "必填项", trigger: "change" }],
        DoChange: [{ required: true, message: "必填项", trigger: "change" }],
        UseTips: [{ required: true, message: "必填项", trigger: "change" }],
        UseTipsNo: [{ required: true, message: "必填项", trigger: "change" }],
        Difficulty: [{ required: true, message: "必填项", trigger: "change" }],
        Helpful: [{ required: true, message: "必填项", trigger: "change" }],
        Train: [{ required: true, message: "必填项", trigger: "change" }],
        NextDifferent: [
          { required: true, message: "必填项", trigger: "change" },
        ],
        ConfidenceLevel: [
          { required: true, message: "必填项", trigger: "change" },
        ],
        Importance: [{ required: true, message: "必填项", trigger: "change" }],
      },
      dialogForm6: false,
      dataObj: {},
      dialogForm9: false,
      formQues: {
        challenge: "",
         DoctorType:"",
         DoctorType_Other:"",
        Reason_a: "",
        Reason_b: "",
        Reason_c: "",
        Reason_d: "",
        Reason_e: "",
        Reason_f: "",
        Reason_g: "",
        Reason_h: "",
        Reason_i: "",
        Reason_j: "",
        Reason_k: "",
        Reason_l: "",
        Satisfaction_SoundRecording: "",
        Satisfaction_Website: "",
        Satisfaction_Team: "",
        Advice: "",
        DifficultThing3: "",
        DifficultThing2: "",
        DifficultThing1: "",
        EasyThing3: "",
        EasyThing2: "",
        EasyThing1: "",
        Frequency: "",
        Usefulness: "",
        SkillLove: "",
        Importance: "",
        Periods: [],
      },
      fileList: [],
      rules7: {},
      hasDoctorReport: false,
      showState: false,
      doctorReport: {},
      BASE_API: "",
      InvalidReason:false,
    };
  },
  filters: {
    IsFillInQuestionFilter(cellValue) {
      if (cellValue == 1) {
        return "已完成";
      } else if (cellValue == 0) {
        return "未完成";
      } else {
        return "-";
      }
    },
    ActualFollowUpTypeFilter(cellValue) {
      if (cellValue == "1") {
        return "面对面";
      } else if (cellValue == "2") {
        return "电话";
      } else if (cellValue == "3") {
        return "微信视频";
      } else {
        return "";
      }
    },
    FollowUpType(cellValue) {
      if (cellValue == 1) {
        return "面对面";
      } else if (cellValue == 2) {
        return "电话";
      } else {
        return "面对面/电话";
      }
    },
    mobileFilter(cellValue) {
      if (cellValue) {
        return cellValue.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
      }
    },
    AppointState(cellValue) {
      if (cellValue == "0") {
        return "待确认";
      } else if (cellValue == "1") {
        return "已确认";
      } else if (cellValue == "2") {
        return "已取消";
      } else {
        return "-";
      }
    },
    FollowUpState(cellValue) {
      if (cellValue == "0") {
        return "待完成";
      } else if (cellValue == "1") {
        return "已完成";
      } else if (cellValue == "2") {
        return "已取消";
      } else if (cellValue == "3") {
        return "爽约";
      } else {
        return "-";
      }
    },
    FollowUpTypeFilter(cellValue) {
      return cellValue == 1
        ? "面对面"
        : cellValue == 2
        ? "电话"
        : "面对面/电话";
    },

    PeriodFilters(cellValue) {
      return filterPeriod(cellValue)
    },
  },
  created() {},
  computed: {
    ...mapGetters(["userIcon", "userId", "token", "RoleGroup", "UserDic"]),
    computedList() {
      let data = Object.values(this.searchData);
      let dataLength = data.filter((val) => {
        return val != "" && val != undefined;
      }).length;
      return dataLength + 2;
    },
  },
  async mounted() {
    let that = this;
    let now = new Date();
    let nowTime = now.getTime();
    let day = now.getDay();
    if (day == 0) {
      //西方从周日算为第一天    2018/10/28
      day = 7;
    }
    let oneDayLong = 24 * 60 * 60 * 1000;
    let MondayTime = nowTime - (day - 1) * oneDayLong;
    let SundayTime = nowTime + (7 - day) * oneDayLong;
    let monday = dateForm(new Date(MondayTime));
    let sunday = dateForm(new Date(SundayTime));
    that.timeDate = [monday, sunday]; //初始化时间范围
    JSON.parse(localStorage.getItem("fllowManage_04"))
      ? (that.searchData = JSON.parse(localStorage.getItem("fllowManage_04")))
      : "";
    await that.GetCommunityDistrict();
    that.searchData.districtNo =
      JSON.parse(that.UserDic).DistrictNo || that.searchData.districtNo || "";
    if (JSON.parse(that.UserDic).IsCommunityOnly == "1") {
      await that.getComselectList();
      that.searchData.communityId = JSON.parse(that.UserDic).CommunityId || "";
      if (that.searchData.communityId) {
        that.CtyIds =
          that.optionsData.find((val) => {
            return val.SYS_ID == JSON.parse(that.UserDic).CommunityId;
          }).CName || "";
      }
    } else {
      await that.getComselectList();
      that.searchData.communityId =
        (JSON.parse(localStorage.getItem("fllowManage_04")) || {})
          .communityId || "";
      that.CtyIds =
        (
          that.optionsData.find((val) => {
            return val.SYS_ID == that.searchData.communityId;
          }) || {}
        ).CName || "";
    }
    let httpL = "";
    if (window.location.href.indexOf("https") >= 0) {
      httpL = "https://";
    } else {
      httpL = "http://";
    }
    let httpName = httpL + window.location.host;
    this.BASE_API = "http://localhost:1442/";
    if (httpName.indexOf("localhost") == -1) {
      this.BASE_API = httpName + "/";
    }
    that.getList();
    that.GetNurse(); // 获取干预护士
    this.GetDoctorSelfReportState();
  },
  methods: {
    followTimes(e){
      if(!this.FormAnli.AppointLengthOfTime){
         this.$notify({
          title: "提示",
          message: "请先选择预计时长！",
          type: "error",
        });
        this.FormAnli.FollowUpOverTime = ""
        return false;
      }
      if(!this.FormAnli.FollowUpDoTime){
         this.$notify({
          title: "提示",
          message: "请先选择访谈开始时间！",
          type: "error",
        });
        this.FormAnli.FollowUpOverTime = ""
        return false;
      }
      console.log(this.FormAnli.FollowUpDoTime,this.FormAnli.FollowUpOverTime)
      let atime = parseInt(this.FormAnli.FollowUpOverTime);
      let btime = parseInt(this.FormAnli.FollowUpOverTime.split(":")[1]);
      let ctime = parseFloat(this.FormAnli.FollowUpDoTime);
      let dtime = parseInt(this.FormAnli.FollowUpDoTime.split(":")[1]);
      if ((atime - ctime) * 60 + btime - dtime < 0) {
        this.$notify({
          title: "提示",
          message: "结束时间应大于开始时间，请核对您的输入是否正确！",
          type: "error",
        });
        this.FormAnli.FollowUpOverTime = ""
        return false;
      }
      if(this.FormAnli.FollowUpDoTime && this.FormAnli.FollowUpOverTime && this.FormAnli.AppointLengthOfTime){
        let time = WeeksBetw(`2000-01-01 ${this.FormAnli.FollowUpOverTime}`,`2000-01-01 ${this.FormAnli.FollowUpDoTime}`)
         this.InvalidReason = (time < (this.FormAnli.AppointLengthOfTime == '1' ? 20 :45)*0.8)
      }
    },
    dateForm(val){
      return dateForm(val)
    },
    removeAudio(row) {
      //删除录音文件
      if (this.RoleGroup > 1 && this.token != row.NurseId) {
        this.$message({
          message:
            "健康访谈人员本人在上传录音文件当天可以删除录音文件。如仍需删除，请联系系统管理员处理！",
          type: "info",
        });
        return false;
      }
      if (
        this.token == row.NurseId &&
        row.SoundRecordingUploadTime.substring(0, 10) != dateForm(new Date())
      ) {
        this.$message({
          message:
            "健康访谈人员本人在上传录音文件当天可以删除录音文件。如仍需删除，请联系系统管理员处理！",
          type: "info",
        });
        return false;
      }
      this.$confirm("此操作将删除录音文件？, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.service({
            url: "/ResearchObject/DeleteSoundRecord",
            method: "post",
            data: {
              SYS_ID: row.QCId,
              NurseId: row.NurseId,
            },
          }).then((res) => {
            this.$message({
              type: "success",
              message: "删除成功!",
            });
            this.getList();
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    download(row) {
      if (this.RoleGroup > 1 && this.token != row.NurseId) {
        this.$message({
          message: "没有下载录音文件的权限！",
          type: "info",
        });
        return false;
      }
      let httpL = "";
      window.location.href.indexOf("https") >= 0
        ? (httpL = "https://")
        : (httpL = "http://");
      let httpName = httpL + window.location.host + "/upload/File/";
      window.open(httpName + row.SoundRecording);
    },
    uploas(row) {
      this.dataObj = row;
      console.log(row);
    },
    handleExceed(files, fileList) {
      this.$message.warning(
        `当前限制选择 1 个文件，本次选择了 ${files.length} 个文件，共选择了 ${
          files.length + fileList.length
        } 个文件`
      );
    },
    handlePreview(response, file) {
      //添加文件回调
      let that = this;
      let data = JSON.parse(response);
      this.dataObj.fileList = [
        {
          name: file.name.split(".")[0],
          url: data.msg,
        },
      ];
      this.service({
        url: "/ResearchObject/UploadSoundRecord",
        method: "post",
        data: {
          NurseId: this.token,
          SoundRecording: data.msg,
          SYS_ID: this.dataObj.QCId,
        },
      })
        .then((res) => {
          this.$message.success("保存成功!");
          this.getList();
        })
        .catch((e) => {
          this.getList();
        });
    },
    watchFilelist: function (file) {
      //点击文件
      let httpL = "";
      window.location.href.indexOf("https") >= 0
        ? (httpL = "https://")
        : (httpL = "http://");
      let httpName = httpL + window.location.host + "/upload/File/";
      window.open(httpName + file.url);
    },
    beforeAvatarUpload: function (files) {
      //上传之前的钩子
      if (
        (this.RoleGroup > 1 && this.token != this.dataObj.NurseId) ||
        this.dataObj.WrittenConsent != 1 ||
        this.dataObj.OralConsent != 1
      ) {
        this.$message({
          message:
            "在口头和电子知情同意均为同意的情况下，只有健康访谈人员本人和系统管理员可以上传录音文件！",
          type: "info",
        });
        return false;
      }
      console.log(files)
      if (files.type.indexOf('mpeg') == -1 && files.type.indexOf('wav') ==  -1) {
        this.$message.error("仅支持mp3或wav格式文件格式！");
        this.fileList = [];
        return false
      }
      return true
    },
    removeDi: function () {
      this.fileList = [];
    },
    changeZk(row, val) {
      //口头同意书
      if (this.RoleGroup > 1 && this.token != row.NurseId) {
        this.$message({
          message: "暂无权限",
          type: "info",
        });
        this.getList()
        return false;
      }
      this.service({
        url: "/ResearchObject/SaveQCOralConsent",
        method: "post",
        data: {
          ...row,
          SYS_ID: row.QCId,
        },
      })
        .then((response) => {
          this.$message({
            message: "修改成功",
            type: "success",
          });
          this.getList();
        })
        .catch((data) => {
          this.getList();
        });
    },
    changeDZ(row, val) {
      //电子知情同意书
      if (this.RoleGroup > 1 && this.token != row.NurseId) {
          this.$message({
            message: "暂无权限",
            type: "info",
          });
          this.getList()
          return false;
        }
      this.service({
        url: "/QC/SaveWrittenConsent",
        method: "post",
        data: {
          ...row,
        },
      })
        .then((response) => {
          this.$message({
            message: "修改成功",
            type: "success",
          });
          this.getList();
        })
        .catch((data) => {
          this.getList();
        });
    },
    GetDoctorSelfReportState() {
      //获取特定人员的自我问卷
      this.service({
        url: "/ResearchObject/GetDoctorSelfReportState",
        method: "get",
        params: {
          nurseId: this.token,
        },
      }).then((res) => {
        if (res.dtData.length > 0) {
          this.doctorReport = res.dtData[0];
          this.service({
            url: "/QC/GetDoctorSelfReport",
            method: "get",
            params: {
              qcId: this.doctorReport.QCId,
            },
          }).then((e) => {
            if(e.dtData.length>0){
              Object.keys(this.formQues).forEach(key => {this.formQues[key]=e.dtData[0][key]})
              e.dtData[0].SYS_ID ? this.formQues.SYS_ID = e.dtData[0].SYS_ID :''
              this.formQues.Periods ? this.formQues.Periods = this.formQues.Periods.split(',') : this.formQues.Periods = []
            }

          });
          this.hasDoctorReport = true;
        }
      });
    },
    getBub(e, index, key) {
      //表格点击事件
      this.formQues[key] = index;
    },
    submitQyes(formName) {
      //提交自我报告问卷
      if (this.rowOff) {
        return false;
      }
      this.rowOff = true;
      this.service({
        url: "/QC/SaveDoctorSelfReport",
        method: "post",
        data: {
          ...this.formQues,
          QCId: this.doctorReport.QCId,
          NurseId: this.token,
          FollowUpId: this.doctorReport.FollowUpId,
          Periods : this.formQues.Periods.join(',')
        },
      })
        .then((response) => {
          this.$message({
            message: response.msg,
            type: "success",
          });
          this.getList();
          this.GetDoctorSelfReportState();
          this.dialogForm9 = false;
          this.rowOff = false;
        })
        .catch((e) => {
          this.rowOff = false;
        });
    },
    handleQuestion() {
      //自我报告问卷
      this.dialogForm9 = true;
    },
    removeReport() {
      //删除自我反馈表
      console.log(this.formFeedback.CreateTime.substring(0,10));
      console.log(dateForm(new Date))
      this.$confirm("此操作将删除该记录, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.service({
            url: "/QC/DeleteSelfFeedback",
            method: "post",
            data: {
              ...this.dataObj,
            },
          }).then((res) => {
            this.$message({
              type: "success",
              message: "删除成功!",
            });
            this.getList();
            this.dialogForm6 = false;
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    submitFeedback(formName) {
      //自我反馈表
      console.log(this.dataObj)
      console.log(this.formFeedback)
      console.log(this.token)
      if (this.rowOff) {
        return false;
      }
      this.rowOff = true;
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.service({
            url: "/QC/SaveSelfFeedback",
            method: "post",
            data: {
              ...this.formFeedback,
              UseTipsNo:this.formFeedback.UseTipsNo && this.formFeedback.UseTipsNo.join(','),
              QCId: this.dataObj.QCId,
              FollowUpId: this.dataObj.SYS_ID,
              Importance:this.formFeedback.Importance.toString(),
              ConfidenceLevel:this.formFeedback.ConfidenceLevel.toString(),
            },
          })
            .then((response) => {
              this.$message({
                message: response.msg,
                type: "success",
              });
              this.getList();
              this.dialogForm6 = false;
              this.rowOff = false;
            })
            .catch((e) => {
              this.rowOff = false;
            });
        } else {
          this.rowOff = false;
          return false;
        }
      });
    },
    handleFeedback(row, index) {
      //自我反馈表
      console.log(row)
      if (index == 2) {
        if (this.RoleGroup > 2 && this.token != row.NurseId) {
          this.$message({
            message: "暂无权限",
            type: "info",
          });
          return false;
        }
        this.service({
          url: "/QC/GetSelfFeedback",
          method: "get",
          params: {
            qcId: row.QCId,
          },
        }).then((res) => {
          this.$nextTick(() => {
            this.$refs["formFeedback"]
              ? this.$refs["formFeedback"].resetFields()
              : "";
            this.dialogForm6 = true;
            !res.dtData[0].UseTipsNo ?res.dtData[0].UseTipsNo = '' :''
            this.formFeedback = res.dtData[0];
            this.formFeedback.ConfidenceLevel = parseInt(this.formFeedback.ConfidenceLevel || 0)
            this.formFeedback.Importance = parseInt(this.formFeedback.Importance || 0)
            this.formFeedback.UseTipsNo = this.formFeedback.UseTipsNo && this.formFeedback.UseTipsNo.split(',') || []
          });
        });
      } else {
        if (
          row.WrittenConsent != 1 ||
          row.OralConsent != 1 ||
          this.token != row.NurseId
        ) {
          this.$message({
            message:
              "在口头和电子知情同意均为同意的情况下，只有健康访谈人员本人可以填写自我反馈表！",
            type: "info",
          });
          return false;
        }
        this.$nextTick(() => {
          this.$refs["formFeedback"]
            ? this.$refs["formFeedback"].resetFields()
            : "";
          this.dialogForm6 = true;
          this.formFeedback = {
            HowInterview: "",
            AskEasily: "",
            SmoothPart: "",
            DoBetter: "",
            UseTips: "",
            Train: "",
            Helpful: "",
            UseTipsNo: [],
            Difficulty: "",
            DoChange: "",
            NextDifferent: "",
            ConfidenceLevel: 0,
            Importance: 0,
          }
        });
      }
      this.dataObj = row;
    },
    outPut: function () {
      //导出
      /* generate workbook object from table */
      var wb = XLSX.utils.table_to_book(
        document.querySelector(".el-table__fixed-right")
      );
      /* get binary string as output */
      var wbout = XLSX.write(wb, {
        bookType: "xlsx",
        bookSST: true,
        type: "array",
        width: "300",
      });
      try {
        FileSaver.saveAs(
          new Blob([wbout], { type: "application/octet-stream" }),
          "健康访谈.xlsx"
        );
      } catch (e) {
        if (typeof console !== "undefined") console.log(e, wbout);
      }
      return wbout;
    },
    deleteCrf() {
      //删除crf
      let that = this;
      that
        .$confirm("确认要删除本条信息吗？", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
        .then(() => {
          that
            .service({
              url: "/ResearchObject/DeleteCaseReport",
              method: "post",
              data: {
                ...that.FormAnli,
              },
            })
            .then((response) => {
              that.dialogFormAnli = false;
              that.getList();
            })
            .catch((data) => {
              that.loadingQ = false;
            });
        })
        .catch(() => {
          that.dialogFormAnli = false;
          that.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
    async GetCommunityDistrict() {
      //获取社区行政区
      let that = this;
      await that
        .service({
          url: "/Dic/GetCommunityDistrict",
          method: "get",
          params: {},
        })
        .then((response) => {
          that.optionDiq = response.dtData;
        })
        .catch((data) => {});
    },
    changeCops: function (val) {
      //多选框
      this.FormAnli.Companions = val.join(",");
    },
    changeFollowUpDate: function (row, val) {
      this.setList(row);
    },
    changeFollowUpState(row, val){
      if(row.IsDraft == '-1'){
        this.$message({
          type:'info',
          message:"您尚未为研究对象生成行动计划"
        })
        this.getList()
      }
      else if(row.IsCreateCaseReport != '1'){
        this.$message({
          type:'info',
          message:"您尚未填写健康访谈CRF"
        })
        this.getList()
      }
      else{
        this.setList(row);
      }
    },
    handleTable: function (row) {
      console.log(row);
      let that = this;
      row.IsCreateCaseReport == 1
        ? (that.hasCount = true)
        : (that.hasCount = false);
      that.Companions = [];
      that.dataRow = "";
      that.dialogFormAnli = true;
      that.formPoint = {};
      that.dataRow = row;
      that.FormAnli = {
        AppointLengthOfTime: "",
        IsUpdateRiskFactor: "",
        IsConfirmWeightCurve: "",
        FollowUpDoTime: "",
        IsWeightFor: "",
        IsFillInBehavioralSelf: "",
        IsDoneSmarter: "",
        WhoTalkMore: "",
        OpenQuestionTime: "",
        PlanFollowUpType: "",
        SmarterTargerDifficultLevel: "",
        Enthusiasm: "",
        IsConfirmNextTime: "",
        FollowUpOverTime: "",
        Satisfaction: "",
        AdviceAndDiscussContent: "",
        Companions: "",
        IsViewHabit: "",
        IsViewNow: "",
        IsContact: "",
        IsFillInLifeStyle: "",
        IsFillInEducationStyle:"",
        IsReviewLifeStyle: "",
        IsCompleteTarget: "",
        FollowUpType: "",
      };
      that.$nextTick(function () {
        that.$refs["FormAnli"].resetFields();
      });
      that.formPoint = row;
      that.FormAnli.ResearchObjectId = row.ResearchObjectId;
      that.FormAnli.FollowUpId = row.SYS_ID;

      that.FormAnli.AppointDate = row.AppointDate || "";

      that
        .service({
          url: "/ResearchObject/GetCaseReport",
          method: "get",
          params: {
            followUpId: row.SYS_ID,
          },
        })
        .then((response) => {
          if (response.dtData.length > 0) {
            that.FormAnli = response.dtData[0];
            console.log(that.FormAnli)
            that.Companions = (response.dtData[0].Companions || "").split(",");
          } else {
            setTimeout(function () {
              that.FormAnli.FollowUpDoTime = row.FollowUpTime;
            }, 500);
          }
          that.FormAnli.PlanFollowUpType = that.formPoint.FollowUpType || "";
          that.FormAnli.FollowUpDoTime = that.FormAnli.FollowUpDoTime.replace("-",":")
          console.log(that.FormAnli);
        })
        .catch((data) => {});
    },
    changeDis(val) {
      this.CtyIds = "";
      this.searchData.communityId = "";
      this.optionsData = [];
      if (val) {
        this.getComselectList();
      }
    },
    // 获取社区列表
    async getComselectList() {
      let that = this;
      await that
        .service({
          url: "dic/GetCommunity",
          method: "get",
          params: {
            cName: "",
            cGroup: "",
            districtNo: that.searchData.districtNo || "",
            pageCount: 0,
            pageSize: 100,
          },
        })
        .then((resp) => {
          if (that.searchData.districtNo && that.searchData.districtNo != "") {
            that.optionsData = resp.dtData;
          } else {
            that.optionsData = [];
          }
        })
        .catch((data) => {});
    },
    changeOther() {
      this.formx.FeedbackOther = "";
    },
    Commutysp(val) {
      this.CtyIds = val.CName;
      val.SYS_ID !== undefined
        ? (this.searchData.communityId = val.SYS_ID)
        : (this.searchData.communityId = "");
    },
    tableSure: function (formName) {
      let that = this;
      if (that.rowOff) {
        return false;
      }
      that.rowOff = true;
      that.$refs[formName].validate((valid) => {
        if (valid) {
          let atime = parseInt(that.FormAnli.FollowUpOverTime);
          let btime = parseInt(that.FormAnli.FollowUpOverTime.split(":")[1]);
          let ctime = parseFloat(that.FormAnli.FollowUpDoTime);
          let dtime = parseInt(that.FormAnli.FollowUpDoTime.split(":")[1]);
          if ((atime - ctime) * 60 + btime - dtime < 0) {
            that.$notify({
              title: "提示",
              message: "结束时间应大于开始时间，请核对您的输入是否正确！",
              type: "error",
            });
            that.rowOff = false;
            return false;
          }
          if ((atime - ctime) * 60 + btime - dtime > 90) {
            that.$notify({
              title: "提示",
              message: "访谈结束时间-开始时间>90分钟，请核对您的输入是否正确！",
              type: "error",
            });
            that.rowOff = false;
            return false;
          }
          if (that.FormAnli.AdviceAndDiscussContent == "") {
            that.$notify({
              title: "提示",
              message: "请填写最后一条",
              type: "error",
            });
            that.rowOff = false;
            return false;
          } else {
            that
              .service({
                url: "/ResearchObject/SaveCaseReport",
                method: "post",
                data: {
                  ...that.FormAnli,
                  NurseId:JSON.parse(that.UserDic).SYS_ID,
                  Nurse : JSON.parse(that.UserDic).UserCode,
                },
              })
              .then((response) => {
                that.dialogFormAnli = false;
                that.$message({
                  message: "保存成功",
                  type: "success",
                });
                that
                  .$confirm("自动将事项状态改为“已完成”，确定吗？", "提示", {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning",
                  })
                  .then(() => {
                    that.dataRow.FollowUpState = "1";
                    that.rowOff = false;
                    that
                      .service({
                        url: "/ResearchObject/ChangeFollowState",
                        method: "post",
                        data: {
                          ...that.dataRow,
                        },
                      })
                      .then((response) => {
                        that.$message({
                          message: "修改成功",
                          type: "success",
                        });
                        that.getList();
                      })
                      .catch((data) => {
                        that.getList();
                      });
                  })
                  .catch(() => {
                    that.$message({
                      type: "info",
                      message: "已取消",
                    });
                    that.getList();
                    that.rowOff = false;
                  });
              })
              .catch((data) => {});
            that.dialogFormAnli = false;
          }
        } else {
          that.rowOff = false;
          return false;
        }
      });
    },
    formXQ6: function (val) {
      //自信程度监听
      if (parseInt(val) <= 3) {
        this.$alert(
          "请询问研究对象是否完善行动计划，以制定研究对象更容易完成和实现的行动计划。",
          "提醒",
          {
            confirmButtonText: "知道了",
          }
        );
      }
    },
    copyMove: function () {
      //复制以往行动计划
      let that = this;
      that.getListQ();
      that.dialogForm2 = true;
    },
    singleChange: function (val) {
      let that = this;
      that.copyObject = val;
    },
    changeFollowUpDateOne: function (row, val) {
      let that = this;
      if (row.AppointState == 0) {
        this.$confirm("是否将预约状态改为已确认 , 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            row.AppointState = "1";
            that.setList(row);
          })
          .catch(() => {
            that.setList(row);
          });
      } else {
        that.setList(row);
      }
    },
    jumpQuestion: function (row) {
      //问卷跳转
      let that = this;
      if (row.IsFillInQuestionnaire == undefined) {
        return false;
      }
      that.$router.push({
        path: "/participant/editor",
        query: {
          id: row.ResearchObjectId,
          mobile: row.Mobile,
          researchNo: row.ResearchNo,
          isOther: 1,
        },
      });
    },
    jumpMove: function (row) {
      //跳转行动计划
      let that = this;
      that.$router.push({
        path: "/participant/editor",
        query: {
          id: row.ResearchObjectId,
          mobile: row.Mobile,
          researchNo: row.ResearchNo,
          isOther: 2,
        },
      });
    },
    JumpUserinfo: function (row) {
      let that = this;
      that.$router.push({
        path: "/participant/editor",
        query: {
          id: row.ResearchObjectId,
          mobile: row.Mobile,
          researchNo: row.ResearchNo,
        },
      });
    },
    UserStateFilter(row, column, cellValue, index) {
      switch (cellValue) {
        case "1":
          return "活跃";
          break;
        case "2":
          return "不活跃";
          break;
        case "3":
          return "不活跃";
          break;
        case "4":
          return "不活跃";
          break;
        case "5":
          return "不活跃";
          break;
      }
    },
    handlelAdd: function (index, row) {
      //生成行动计划
      let that = this;
      that.onOFFsub = false;
      that.formPoint = {};
      that.subDisabled = false;
      if (new Date(row.FollowUpDate).getTime() > new Date().getTime()) {
        that.$message({
          message: "不能生成未来日期的行动计划，请检查操作是否有误",
          type: "info",
        });
        return false;
      }
      if (row.HasCreatePlan == 1) {
        that.$message({
          message: "请对此前的行动计划进行结果评估",
          type: "info",
        });
       // return false;
      }
      that.sysId = row.SYS_ID;
      that.tablerow = row;
      that.ResearchObjectId = row.ResearchObjectId;
      that.ScheduleId = row.ScheduleId;
      (that.formx = {
        FeedbackPerson: "1",
        FeedbackOther: "",
        Title: "",
        Q1: "",
        Q2_1: "",
        Q2_2: "",
        Q2_3: "",
        Q2_4: "",
        Q2_5: "",
        Q2_6: "",
        Q2_7: "",
        Q2_8: "",
        Q3_1: "",
        Q3_2: "",
        Q3_3: "",
        Q4_1: "",
        Q4_2: "",
        Q4_3: "",
        Q5_1: "",
        Q5_2: "",
        Q5_3: "",
        Q6: null,
        Q7: null,
        Result: null,
        IsDraft: "",
        PlanType: "",
      }),
        (that.formPoint = row);
      that.dialogForm1 = true;
    },
    handleSizeChange(val) {
      //条数改变
      this.pageSize = val;
      this.getList();
    },
    handleCurrentChange(val) {
      //页数改变
      this.pageId = val;
      this.getList();
    },
    handleSizeChangeQ(val) {
      //条数改变
      this.pageSizeQ = val;
      this.getListQ();
    },
    handleCurrentChangeQ(val) {
      //页数改变
      this.pageIdQ = val;
      this.getListQ();
    },
    submitForm: function (type) {
      //提交
      let that = this;
      if (that.onOFFsub) {
        that.subDisabled = true;
        return false;
      }
      that.onOFFsub = true;
      if (
        (this.formx.Title == "" ||
          this.formx.Q1 == "" ||
          this.formx.Q2_1 == "" ||
          this.formx.Q2_2 == "" ||
          this.formx.Q2_3 == "" ||
          this.formx.Q2_4 == "" ||
          this.formx.Q2_5 == "" ||
          this.formx.Q2_6 == "" ||
          this.formx.Q2_7 == "" ||
          this.formx.Q2_8 == "" ||
          this.formx.Q3_1 == "" ||
          this.formx.Q4_1 == "" ||
          this.formx.Q5_1 == "" ||
          this.formx.Q6 == "" ||
          this.formx.Q7 == "") &&
        (type == 1 || this.formx.Title == "")
      ) {
        that.$message({
          message: "所有项为必填，请认真填写，草稿需填写标题",
          type: "warning",
        });
        that.onOFFsub = false;
        return false;
      }
      if (this.formx.FeedbackPerson == "7" && this.formx.FeedbackOther == "") {
        that.$message({
          message: "请填入其他具体成员",
          type: "warning",
        });
        that.onOFFsub = false;
        return false;
      }
      setTimeout(() => {
        that
          .service({
            url: "/ResearchObject/SavePlan",
            method: "post",
            data: {
              FollowUpId: that.sysId,
              ResearchObjectId: that.ResearchObjectId,
              ScheduleId: that.ScheduleId,
              ...that.formx,
              IsDraft: type,
              PlanCreater: that.userIcon,
              PlanCreaterId: that.token,
              Result: null,
            },
          })
          .then((response) => {
            that.dialogForm1 = false;
            that.getList();
          })
          .catch((data) => {
            that.onOFFsub = false;
            that.subDisabled = false;
          });
      }, 200);
    },
    setList: function (row) {
      //修改
      let that = this;
      that
        .service({
          url: "/ResearchObject/SaveFollowUp",
          method: "post",
          data: {
            ...row,
          },
        })
        .then((response) => {
          that.$message({
            message: "修改成功",
            type: "success",
          });
          that.getList();
        })
        .catch((data) => {
          that.getList();
        });
    },
    getList() {
      //获取一级信息列表
      let that = this;
      that.loading = true;
      that
        .service({
          url: "/ResearchObject/GetFollowUp",
          method: "get",
          params: {
            pageCount: that.pageId - 1,
            pageSize: that.pageSize,
            ...that.searchData,
            startDate: that.timeDate ? that.timeDate[0] : "",
            endDate: that.timeDate ? that.timeDate[1] : "",
          },
        })
        .then((response) => {
          console.log(response);
          that.tableData = response.dtData;
          that.total = parseInt(response.dtData[0].TotalCount);
          that.loading = false;
        })
        .catch((data) => {
          that.loading = false;
        });
    },
    checkList: function () {
      this.pageId = 1;
      this.pageSize = 10;
      this.total = null;
      this.getList();
      let storageObj = this.searchData;
      this.searchData.comName = this.CtyIds;
      localStorage.setItem("fllowManage_04", JSON.stringify(storageObj));
    },
    makeSurecopy: function () {
      //确认复制
      let that = this;
      if (that.copyObject == null) {
        that.$message({
          message: "请选择一项行动计划",
          type: "info",
        });
        return false;
      }
      if (that.copyObject && that.copyObject.length > 0) {
        let val = that.copyObject;
        that.formx = {
          Title: val[0].Title,
          Q1: val[0].Q1,
          Q2_1: val[0].Q2_1,
          Q2_2: val[0].Q2_2,
          Q2_3: val[0].Q2_3,
          Q2_4: val[0].Q2_4,
          Q2_5: val[0].Q2_5,
          Q2_6: val[0].Q2_6,
          Q2_7: val[0].Q2_7,
          Q2_8: val[0].Q2_8,
          Q3_1: val[0].Q3_1,
          Q3_2: val[0].Q3_2,
          Q3_3: val[0].Q3_3,
          Q4_1: val[0].Q4_1,
          Q4_2: val[0].Q4_2,
          Q4_3: val[0].Q4_3,
          Q5_1: val[0].Q5_1,
          Q5_2: val[0].Q5_2,
          Q5_3: val[0].Q5_3,
          Q6: parseInt(val[0].Q6),
          Q7: parseInt(val[0].Q7),
          Result: null,
          IsDraft: "",
          PlanType: val[0].PlanType,
        };
      }
      that.dialogForm2 = false;
    },
    getListQ: function () {
      //获取一级信息列表
      let that = this;
      that
        .service({
          url: "/ResearchObject/GetParticipantDetail",
          method: "get",
          params: {
            itemType: "5",
            sysId: "",
            Period: "",
            researchObjectId: that.tablerow.ResearchObjectId,
            mobile: that.tablerow.Mobile,
            researchNo: that.tablerow.ResearchNo,
            pageCount: that.pageIdQ - 1,
            pageSize: that.pageSizeQ,
          },
        })
        .then((response) => {
          that.loadingQ = false;
          that.tableDataQ = response.dtData.dtPlan;
          that.totalQ = parseInt(response.dtData.dtPlan[0].TotalCount);
        })
        .catch((data) => {
          that.loadingQ = false;
        });
    },
    GetNurse: function () {
      let that = this;
      that
        .service({
          url: "/Sys/GetNurseForFollowup",
          method: "get",
          params: {
            communityId: JSON.parse(this.UserDic).CommunityId || "",
          },
        })
        .then((response) => {
          that.SearchoptionsNurse = response.dtData;
          let options = response.dtData.filter((e) => {
            return e.IsStopUse == "0";
          });
          for (let i of options) {
            //处理姓名账号不一致，Nan
            i.Name = i.Name || "";
            let username = i.Surname + i.Name;
            username == "undefined"
              ? (username = i.UserCode)
              : (username = username);
            i.icons = username;
          }
          that.optionsNurse = options;
        })
        .catch((data) => {});
    },
    changeNurse: function (row, val) {
      let that = this;
      this.$confirm("更换访谈人员后，请重新填写访谈时间, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          that.optionsNurse.forEach(function (item) {
            //绑定ID
            if (item.NurseName == val) {
              row.NurseId = item.NurseId;
            }
          });
          row.FollowUpTime = "";
          this.setList(row);
        })
        .catch(() => {
          that.$message({
            message: "已取消",
            type: "info",
          });
          that.getList();
        });
    },
  },
};
function actions() {
  let httpL = "";
  if (window.location.href.indexOf("https") >= 0) {
    httpL = "https://";
  } else {
    httpL = "http://";
  }
  let httpName = httpL + window.location.host;
  let BASE_API = "http://localhost:1442/api";
  if (httpName.indexOf("localhost") == -1) {
    BASE_API = httpName + "/API/105/api/";
  }
  return BASE_API + "/Dic/PostFiles";
}
function addZero(s) {
  return s < 10 ? "0" + s : s;
}
function dateForm(data) {
  return (
    new Date(data).getFullYear() +
    "-" +
    addZero(new Date(data).getMonth() + 1) +
    "-" +
    addZero(new Date(data).getDate())
  );
}

function WeeksBetw(date1,date2) {  //计算日期之间相
    var _dt1=new Date(date1);
    var _dt2=new Date(date2);
    var dt1=_dt1.getTime();
    var dt2=_dt2.getTime();
    console.log(dt2,dt1)
    return parseInt(Math.abs(dt1- dt2)/1000/60);
}
</script>
<style scoped lang="scss">
.formX {
  .top {
    text-align: left;
  }
  ul {
    li {
      margin: 20px 0px;
      h3 {
        color: #606266;
        font-weight: normal;
        font-size: 14px;
      }
      h5 {
        font-weight: normal;
        margin: 5px 0;
      }
      p {
        color: #999999;
        margin-bottom: 10px;
        margin: 10px 0px;
      }
    }
  }
}
.click_line {
  cursor: pointer;
  color: #409eff;
}
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.4s;
}
.fade-enter,
.fade-leave-to {
  opacity: 0;
}
.formPlebek {
  color: #0066ff;
}
.pagination-fixed {
  position: static;
}
.excelHidden {
  display: none !important;
}
.formScore {
  ul {
    li {
      margin-bottom: 20px;
      h3 {
        color: #333;
        font-weight: normal;
        font-size: 12px;
      }
      p {
        font-size: 14px;
        color: #666;
      }
    }
  }
}
.parentDiv {
  margin: 15px 0px;
  table {
    width: 100%;
    border-collapse: collapse;
    tr {
      td {
        border: 1px solid #dcdfe6;
        box-sizing: border-box;
        padding: 8px 0px;
        text-align: center;
        color: #606266;
      }
      .active {
        background: #2da3fb;
        color: #fff;
      }
    }
  }
}
</style>
